home *** CD-ROM | disk | FTP | other *** search
/ Aminet 31 / Aminet 31 (1999)(Schatztruhe)[!][Jun 1999].iso / Aminet / mus / midi / XGToolset5_src.lha / XGToolset_src / XGMPart / XGMpart.c < prev    next >
C/C++ Source or Header  |  1999-03-15  |  134KB  |  3,059 lines

  1. /*
  2.     XG-Multipart-Editor V1.4
  3.  
  4.     A Bars and Pipes tool for editing the DB50-XG-board from  YAMAHA.  It's
  5.     also  useable   for  other  GM-equipment.  But  then  don't  touch  the
  6.     Bank-slider.
  7.  
  8.     Use it together with the other XG ... .ptool ' s -
  9.  
  10.     © 1998 Alfred & Matthias Faust
  11.  
  12.     The Tool-code based farly on the code for the "pc3.ptool" from  Richard
  13.     Hagen. That's a very good tool,  many thanks to him.
  14.  
  15.     Richard has written his tool with DICE. We altered the code to  compile
  16.     with  the  free  GNU-C-compiler  of  the  ADE.  Especially the part was
  17.     transcripted,   that  place  the  imagedate  in  chip-RAM,   because  the
  18.     GNU-C-compiler  hasn't as yet a keyword like DICE or other compiler for
  19.     this.
  20.  
  21.     This code is released  into  the  Public  Domain,   and  may  be  freely
  22.     distributed in its original form.
  23.  
  24.     It is supplied ``as is'',  and comes with no warranty. This program code
  25.     was  released  because it might be useful as a starting point for other
  26.     programmers. However,  if any damage arises from its use,   the  original
  27.     author and we will not be held liable.
  28.  
  29.     You are free to use and modify  this  code  to  your  heart's  content,
  30.     provided you acknowledge me as the original author in any code that you
  31.     might distribute which is based largely on this code.
  32.  
  33.     I acknowledge that the design of this tool is  influenced  strongly  by
  34.     the  example code supplied with the Rules for Tools package. However,  I
  35.     have made substantial contributions of my own.
  36.  
  37.     Matthias & Alfred Faust
  38.     j.k.dax@t-online.de
  39.  
  40.     History:
  41.         1.0 (17.11.1998)
  42.         Initial Release.
  43.  
  44.         1.1 (06.01.1999)
  45.         Removed a bug in the Bank-selection
  46.         now works fine
  47.  
  48.         1.2 (03.02.1999)
  49.         altered the order of the sysex, written to track
  50.  
  51.         1.3 (13.02.1999)
  52.         all slidervalues will be stored with the tool in the track
  53.  
  54.         1.4 (15.03.1999)
  55.         altered the GUI
  56.         added 4 Pitch-EG-sliders
  57.     
  58. */
  59.  
  60. #include "bars.h"
  61. #include "myheader.h"  // from R.Hagen
  62. #include <libraries/dos.h>
  63. #include <proto/exec.h>
  64. #include <proto/intuition.h>
  65. #include <proto/graphics.h>
  66. #include <exec/memory.h>
  67. #include <exec/execbase.h>
  68. #include <exec/types.h>
  69. #include <string.h>
  70. #include <intuition/intuition.h>
  71.  
  72. #include "soundmatrix.c"  //all the soundnames
  73.  
  74. char version[]="\0$VER:MultipartXG-Edit 1.4(15.03.1999) © Alfred & Matthias Faust";
  75.  
  76. #define MPXG_NAME "XG-Multipart-Edit"
  77.  
  78. #define MPXG_ID          0x34505847
  79. #define MPXG_TYPE        (TOOL_NORMAL | TOOL_NOTPAD)
  80.  
  81. //all the values of the slider-storage
  82. UBYTE initstorage[720]={
  83. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  84. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  85. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  86. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  87. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  88. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  89. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  90. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  91. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  92. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  93. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  94. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  95. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  96. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  97. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,
  98. 0,0,0,0,1,1,24,8,0,100,64,64,127,64,127,0,127,0,40,0,64,64,64,64,64,64,64,64,0,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64};
  99.  
  100. // translation between the value of tool->bank and used value
  101.  
  102. UBYTE bnk[]=
  103.   {0, 1, 3, 6, 8, 12, 14, 16, 17, 18, 19, 20, 24, 25, 27, 28, 32, 33, 34, 35, 36, 37, 38, 40,
  104.   41, 42, 43, 45, 64, 65, 66, 67, 68, 69, 70, 71, 72, 96, 97, 98, 99, 100, 101};
  105.  
  106. // the litte Icon in the pipeline
  107.  
  108. UWORD *MPXG=NULL;
  109.  
  110. static UWORD MPXGdata[] =
  111. {
  112.         /* Plane 0 */
  113.                 0x7FFF,0xFE00,
  114.                 0x7FFF,0xFE00,
  115.                 0x600F,0xEE00,
  116.                 0x6007,0xCE00,
  117.                 0x7FF1,0x8E00,
  118.                 0x6000,0x0E00,
  119.                 0x6000,0x0E00,
  120.                 0x7FF1,0x8E00,
  121.                 0x6007,0xCE00,
  122.                 0x600F,0xEE00,
  123.                 0x7FFF,0xFE00,
  124.                 0x7FFF,0xFE00,
  125.         /* Plane 1 */
  126.                 0x0000,0x0200,
  127.                 0x0000,0x0600,
  128.                 0x1CCF,0xFE00,
  129.                 0x1CC7,0xFE00,
  130.                 0x9FF1,0xFF00,
  131.                 0x9CCC,0x7F00,
  132.                 0x9CCC,0x7F00,
  133.                 0x9FF1,0xFF00,
  134.                 0x1CC7,0xFE00,
  135.                 0x1CCF,0xFE00,
  136.                 0x1FFF,0xFE00,
  137.                 0x3FFF,0xFE00,
  138.         /* Plane 2 */
  139.                 0x0000,0x0000,
  140.                 0x0000,0x0000,
  141.                 0x1FFF,0xF800,
  142.                 0x1FFF,0xF800,
  143.                 0x1FFF,0xF800,
  144.                 0x1FFF,0xF800,
  145.                 0x1FFF,0xF800,
  146.                 0x1FFF,0xF800,
  147.                 0x1FFF,0xF800,
  148.                 0x1FFF,0xF800,
  149.                 0x0000,0x0000,
  150.                 0x0000,0x0000
  151.  
  152. };
  153.  
  154. static struct Image MPXG_image = {
  155.   0, 0,
  156.   24 ,  12 ,  3 ,
  157.   NULL,
  158.   0x1f, 0x00,
  159.   NULL
  160. };
  161.  
  162. //Definitions of the gadgets
  163.  
  164. #define VOICETYP_GADGET      1
  165. #define BANK_GADGET          2
  166. #define PROGRAM_GADGET       3
  167. #define MIDICHAN_GADGET      4
  168. #define PART_GADGET          5
  169. #define MONOPOLY_GADGET      6
  170. #define KEYAS_GADGET         7
  171. #define NOTESHIFT_GADGET     8
  172. #define DETUNER_GADGET       9
  173. #define DETUNEF_GADGET       10
  174. #define VOLUME_GADGET        11
  175. #define VELSDEPTH_GADGET     12
  176. #define VELSOFFSET_GADGET    13
  177. #define VELIHIGH_GADGET      14
  178. #define PAN_GADGET           15
  179. #define NOTELIHIGH_GADGET    16
  180. #define NOTELILOW_GADGET     17
  181. #define DRY_GADGET           18
  182. #define CHORUS_GADGET        19
  183. #define REVERB_GADGET        20
  184. #define VARFX_GADGET         21
  185. #define VIBRATE_GADGET       22
  186. #define VIBDEPTH_GADGET      23
  187. #define VIBDELAY_GADGET      24
  188. #define FICUTOFFREQ_GADGET   25
  189. #define FICUTOFFRESON_GADGET 26
  190. #define ATTACK_GADGET        27
  191. #define DECAY_GADGET         28
  192. #define RELEASE_GADGET       29
  193. #define VXON_GADGET          30
  194. #define TUNEC_GADGET         31
  195. #define TUNECIS_GADGET       32
  196. #define TUNED_GADGET         33
  197. #define TUNEDIS_GADGET       34
  198. #define TUNEE_GADGET         35
  199. #define TUNEF_GADGET         36
  200. #define TUNEFIS_GADGET       37
  201. #define TUNEG_GADGET         38
  202. #define TUNEGIS_GADGET       39
  203. #define TUNEA_GADGET         40
  204. #define TUNEAIS_GADGET       41
  205. #define TUNEB_GADGET         42
  206. #define PINILVL_GADGET       43
  207. #define PATTACK_GADGET       44
  208. #define PRELLVL_GADGET       45
  209. #define PRELTIM_GADGET       46
  210.  
  211. #define WRITE_GADGET         47
  212. #define DEFAULT_GADGET       48
  213.  
  214.  
  215. //all the gadgets
  216.  
  217. // VOICETYP gadget.
  218. struct PropInfo MPXGGadget1SInfo = {
  219.   AUTOKNOB+FREEHORIZ, 0, -1,  MAXBODY * 1/2 , -1, };
  220. struct Image MPXGImage1 = {
  221.   0, 0, 10, 6, 0, NULL, 0x0000, 0x0000, NULL };
  222. struct Gadget MPXGGadget1 = {
  223.   NULL, 33, 29, 14, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  224.   (APTR)&MPXGImage1, NULL, NULL, NULL, (APTR)&MPXGGadget1SInfo, VOICETYP_GADGET, NULL };
  225.  
  226. // BANK gadget.
  227. struct PropInfo MPXGGadget2Info = {
  228.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  229. struct Image MPXGImage2 = {
  230.   0, 0, 10, 6, 0, NULL, 0x0000, 0x0000, NULL };
  231. struct IntuiText MPXGText2 = {
  232.   2, 0, JAM1, -43,  1, NULL, " Bank", NULL };
  233. struct Gadget MPXGGadget2 = {
  234.   &MPXGGadget1, 48, 50, 157, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  235.   (APTR)&MPXGImage2, NULL, &MPXGText2, NULL, (APTR)&MPXGGadget2Info, BANK_GADGET, NULL };
  236.  
  237. // PROGRAM gadget.
  238. struct PropInfo MPXGGadget3Info = {
  239.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  240. struct Image MPXGImage3 = {
  241.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  242. struct IntuiText MPXGText3 = {
  243.   2, 0, JAM1, -43, 1, NULL, "Prgm#", NULL };
  244. struct Gadget MPXGGadget3 = {
  245.   &MPXGGadget2, 48, 60, 157, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  246.   (APTR)&MPXGImage3, NULL, &MPXGText3, NULL, (APTR)&MPXGGadget3Info, PROGRAM_GADGET, NULL };
  247.  
  248. // MIDI-CHANNEL gadget.
  249. struct PropInfo MPXGGadget4SInfo = {
  250.   AUTOKNOB+FREEHORIZ, 0, -1,  MAXBODY *1/16, -1, };
  251. struct Image MPXGImage4 = {
  252.   0, 0, 10, 6, 0, NULL, 0x0000, 0x0000, NULL };
  253. struct IntuiText MPXGText4 = {
  254.   2, 0, JAM1, 35, 1, NULL, "MIDI-Ch:", NULL };
  255. struct Gadget MPXGGadget4 = {
  256.   &MPXGGadget3, 125, 17, 28, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  257.   (APTR)&MPXGImage4, NULL, &MPXGText4, NULL, (APTR)&MPXGGadget4SInfo, MIDICHAN_GADGET, NULL };
  258.  
  259. // PART gadget.
  260. struct PropInfo MPXGGadget5SInfo = {
  261.   AUTOKNOB+FREEHORIZ, 0, -1,  MAXBODY * 1/16, -1, };
  262. struct Image MPXGImage5 = {
  263.   0, 0, 10, 6, 0, NULL, 0x0000, 0x0000, NULL };
  264. struct IntuiText MPXGText5 = {
  265.   2, 0, JAM1, 33, 1, NULL, "Part:", NULL };
  266. struct Gadget MPXGGadget5 = {
  267.   &MPXGGadget4, 33, 17, 28, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  268.   (APTR)&MPXGImage5, NULL, &MPXGText5, NULL, (APTR)&MPXGGadget5SInfo, PART_GADGET, NULL };
  269.  
  270. // MONOPOLY gadget.
  271. struct PropInfo MPXGGadget6SInfo = {
  272.   AUTOKNOB+FREEHORIZ, 0, -1,  MAXBODY * 1/2 , -1, };
  273. struct Image MPXGImage6 = {
  274.   0, 0, 10, 6, 0, NULL, 0x0000, 0x0000, NULL };
  275. struct Gadget MPXGGadget6 = {
  276.   &MPXGGadget5, 125, 29, 14, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  277.   (APTR)&MPXGImage6, NULL, NULL, NULL, (APTR)&MPXGGadget6SInfo, MONOPOLY_GADGET, NULL };
  278.  
  279. // KEYAS gadget.
  280. struct PropInfo MPXGGadget7SInfo = {
  281.   AUTOKNOB+FREEHORIZ, 0, -1,  MAXBODY * 1/3 , -1, };
  282. struct Image MPXGImage7 = {
  283.   0, 0, 10, 6, 0, NULL, 0x0000, 0x0000, NULL };
  284. struct Gadget MPXGGadget7 = {
  285.   &MPXGGadget6, 182, 29, 14, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  286.   (APTR)&MPXGImage7, NULL, NULL, NULL, (APTR)&MPXGGadget7SInfo, KEYAS_GADGET, NULL };
  287.  
  288. // NOTESHIFT Gadget
  289. struct PropInfo MPXGGadget8Info = {
  290.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/49,  -1, };
  291. struct Image MPXGImage8 = {
  292.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  293. struct IntuiText MPXGText8 = {
  294.   2, 0, JAM1, -63, 1, NULL, "Ntshift", NULL };
  295. struct Gadget MPXGGadget8 = {
  296.   &MPXGGadget7, 70, 70, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  297.   (APTR)&MPXGImage8, NULL, &MPXGText8, NULL, (APTR)&MPXGGadget8Info, NOTESHIFT_GADGET, NULL };
  298.  
  299. // DETUNE rough gadget
  300. struct PropInfo MPXGGadget9Info = {
  301.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/16,  -1, };
  302. struct Image MPXGImage9 = {
  303.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  304. struct IntuiText MPXGText9 = {
  305.   2, 0, JAM1, -63, 1, NULL, "DetRogh", NULL };
  306. struct Gadget MPXGGadget9 = {
  307.   &MPXGGadget8, 70, 80, 28, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  308.   (APTR)&MPXGImage9, NULL, &MPXGText9, NULL, (APTR)&MPXGGadget9Info, DETUNER_GADGET, NULL };
  309.  
  310. // DETUNE fine Gadget
  311. struct PropInfo MPXGGadget10Info = {
  312.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/255,  -1, };
  313. struct Image MPXGImage10 = {
  314.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  315. struct IntuiText MPXGText10 = {
  316.   2, 0, JAM1, -53, 1, NULL, "DtFine", NULL };
  317. struct Gadget MPXGGadget10 = {
  318.   &MPXGGadget9, 177, 80, 28, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  319.   (APTR)&MPXGImage10, NULL, &MPXGText10, NULL, (APTR)&MPXGGadget10Info, DETUNEF_GADGET, NULL };
  320.  
  321. // VOLUME Gadget
  322. struct PropInfo MPXGGadget11Info = {
  323.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  324. struct Image MPXGImage11 = {
  325.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  326. struct IntuiText MPXGText11 = {
  327.   2, 0, JAM1, -63, 1, NULL, "Volume ", NULL };
  328. struct Gadget MPXGGadget11 = {
  329.   &MPXGGadget10, 70, 90, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  330.   (APTR)&MPXGImage11, NULL, &MPXGText11, NULL, (APTR)&MPXGGadget11Info, VOLUME_GADGET, NULL };
  331.  
  332. // VELSDEPTH Gadget
  333. struct PropInfo MPXGGadget12Info = {
  334.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  335. struct Image MPXGImage12 = {
  336.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  337. struct IntuiText MPXGText12 = {
  338.   2, 0, JAM1, -63, 1, NULL, "VelsDpt", NULL };
  339. struct Gadget MPXGGadget12 = {
  340.   &MPXGGadget11, 70, 100, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  341.   (APTR)&MPXGImage12, NULL, &MPXGText12, NULL, (APTR)&MPXGGadget12Info, VELSDEPTH_GADGET, NULL };
  342.  
  343. // VELSOFFSET Gadget
  344. struct PropInfo MPXGGadget13Info = {
  345.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  346. struct Image MPXGImage13 = {
  347.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  348. struct IntuiText MPXGText13 = {
  349.   2, 0, JAM1, -63, 1, NULL, "VelsOff", NULL };
  350. struct Gadget MPXGGadget13 = {
  351.   &MPXGGadget12, 70, 110, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  352.   (APTR)&MPXGImage13, NULL, &MPXGText13, NULL, (APTR)&MPXGGadget13Info, VELSOFFSET_GADGET, NULL };
  353.  
  354. // VELIHIGH Gadget
  355. struct PropInfo MPXGGadget14Info = {
  356.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  357. struct Image MPXGImage14 = {
  358.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  359. struct IntuiText MPXGText14 = {
  360.   2, 0, JAM1, -63, 1, NULL, "VeLiHig", NULL };
  361. struct Gadget MPXGGadget14 = {
  362.   &MPXGGadget13, 70, 120, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  363.   (APTR)&MPXGImage14, NULL, &MPXGText14, NULL, (APTR)&MPXGGadget14Info, VELIHIGH_GADGET, NULL };
  364.  
  365. // PAN Gadget
  366. struct PropInfo MPXGGadget15Info = {
  367.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  368. struct Image MPXGImage15 = {
  369.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  370. struct IntuiText MPXGText15 = {
  371.   2, 0, JAM1, -63, 1, NULL, "Panpot ", NULL };
  372. struct Gadget MPXGGadget15 = {
  373.   &MPXGGadget14, 70, 130, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  374.   (APTR)&MPXGImage15, NULL, &MPXGText15, NULL, (APTR)&MPXGGadget15Info, PAN_GADGET, NULL };
  375.  
  376. // NOTELIHIGH Gadget
  377. struct PropInfo MPXGGadget16Info = {
  378.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  379. struct Image MPXGImage16 = {
  380.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  381. struct IntuiText MPXGText16 = {
  382.   2, 0, JAM1, -63, 1, NULL, "NoLiHig", NULL };
  383. struct Gadget MPXGGadget16 = {
  384.   &MPXGGadget15, 70, 140, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  385.   (APTR)&MPXGImage16, NULL, &MPXGText16, NULL, (APTR)&MPXGGadget16Info, NOTELIHIGH_GADGET, NULL };
  386.  
  387. // NOTELILOW Gadget
  388. struct PropInfo MPXGGadget17Info = {
  389.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  390. struct Image MPXGImage17 = {
  391.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  392. struct IntuiText MPXGText17 = {
  393.   2, 0, JAM1, -63, 1, NULL, "NoLiLow", NULL };
  394. struct Gadget MPXGGadget17 = {
  395.   &MPXGGadget16, 70, 150, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  396.   (APTR)&MPXGImage17, NULL, &MPXGText17, NULL, (APTR)&MPXGGadget17Info, NOTELILOW_GADGET, NULL };
  397.  
  398. // DRY Level Gadget
  399. struct PropInfo MPXGGadget18Info = {
  400.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  401. struct Image MPXGImage18 = {
  402.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  403. struct IntuiText MPXGText18 = {
  404.   2, 0, JAM1, -63, 1, NULL, "DryLevl", NULL };
  405. struct Gadget MPXGGadget18 = {
  406.   &MPXGGadget17, 70, 160, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  407.   (APTR)&MPXGImage18, NULL, &MPXGText18, NULL, (APTR)&MPXGGadget18Info, DRY_GADGET, NULL };
  408.  
  409. // CHORUS Gadget
  410. struct PropInfo MPXGGadget19Info = {
  411.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  412. struct Image MPXGImage19 = {
  413.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  414. struct IntuiText MPXGText19 = {
  415.   2, 0, JAM1, -63, 1, NULL, "Chorus ", NULL };
  416. struct Gadget MPXGGadget19 = {
  417.   &MPXGGadget18, 70, 170, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  418.   (APTR)&MPXGImage19, NULL, &MPXGText19, NULL, (APTR)&MPXGGadget19Info, CHORUS_GADGET, NULL };
  419.  
  420. // REVERB Gadget
  421. struct PropInfo MPXGGadget20Info = {
  422.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  423. struct Image MPXGImage20 = {
  424.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  425. struct IntuiText MPXGText20 = {
  426.   2, 0, JAM1, -63, 1, NULL, "Reverb ", NULL };
  427. struct Gadget MPXGGadget20 = {
  428.   &MPXGGadget19, 70, 180, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  429.   (APTR)&MPXGImage20, NULL, &MPXGText20, NULL, (APTR)&MPXGGadget20Info, REVERB_GADGET, NULL };
  430.  
  431. // VARFX Gadget
  432. struct PropInfo MPXGGadget21Info = {
  433.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  434. struct Image MPXGImage21 = {
  435.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  436. struct IntuiText MPXGText21 = {
  437.   2, 0, JAM1, -63, 1, NULL, "Var-FX ", NULL };
  438. struct Gadget MPXGGadget21 = {
  439.   &MPXGGadget20, 70, 190, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  440.   (APTR)&MPXGImage21, NULL, &MPXGText21, NULL, (APTR)&MPXGGadget21Info, VARFX_GADGET, NULL };
  441.  
  442. // VIBRATE Gadget
  443. struct PropInfo MPXGGadget22Info = {
  444.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  445. struct Image MPXGImage22 = {
  446.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  447. struct IntuiText MPXGText22 = {
  448.   2, 0, JAM1, -63, 1, NULL, "VibRate", NULL };
  449. struct Gadget MPXGGadget22 = {
  450.   &MPXGGadget21, 70, 200, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  451.   (APTR)&MPXGImage22, NULL, &MPXGText22, NULL, (APTR)&MPXGGadget22Info, VIBRATE_GADGET, NULL };
  452.  
  453. // VIBDEPTH Gadget
  454. struct PropInfo MPXGGadget23Info = {
  455.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  456. struct Image MPXGImage23 = {
  457.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  458. struct IntuiText MPXGText23 = {
  459.   2, 0, JAM1, -63, 1, NULL, "VibDpth", NULL };
  460. struct Gadget MPXGGadget23 = {
  461.   &MPXGGadget22, 70, 210, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  462.   (APTR)&MPXGImage23, NULL, &MPXGText23, NULL, (APTR)&MPXGGadget23Info, VIBDEPTH_GADGET, NULL };
  463.  
  464. // VIBDELAY Gadget
  465. struct PropInfo MPXGGadget24Info = {
  466.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  467. struct Image MPXGImage24 = {
  468.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  469. struct IntuiText MPXGText24 = {
  470.   2, 0, JAM1, -63, 1, NULL, "VibDlay", NULL };
  471. struct Gadget MPXGGadget24 = {
  472.   &MPXGGadget23, 70, 220, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  473.   (APTR)&MPXGImage24, NULL, &MPXGText24, NULL, (APTR)&MPXGGadget24Info, VIBDELAY_GADGET, NULL };
  474.  
  475. // FICUTOFFREQ Gadget
  476. struct PropInfo MPXGGadget25Info = {
  477.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  478. struct Image MPXGImage25 = {
  479.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  480. struct IntuiText MPXGText25 = {
  481.   2, 0, JAM1, -63, 1, NULL, "FiCtFrq", NULL };
  482. struct Gadget MPXGGadget25 = {
  483.   &MPXGGadget24, 70, 230, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  484.   (APTR)&MPXGImage25, NULL, &MPXGText25, NULL, (APTR)&MPXGGadget25Info, FICUTOFFREQ_GADGET, NULL };
  485.  
  486. // FICUTOFRESON Gadget
  487. struct PropInfo MPXGGadget26Info = {
  488.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  489. struct Image MPXGImage26 = {
  490.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  491. struct IntuiText MPXGText26 = {
  492.   2, 0, JAM1, -63, 1, NULL, "FiCtRes", NULL };
  493. struct Gadget MPXGGadget26 = {
  494.   &MPXGGadget25, 70, 240, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  495.   (APTR)&MPXGImage26, NULL, &MPXGText26, NULL, (APTR)&MPXGGadget26Info, FICUTOFFRESON_GADGET, NULL };
  496.  
  497. // ATTACK Gadget
  498. struct PropInfo MPXGGadget27Info = {
  499.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  500. struct Image MPXGImage27 = {
  501.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  502. struct IntuiText MPXGText27 = {
  503.   2, 0, JAM1, -63, 1, NULL, "Attack ", NULL };
  504. struct Gadget MPXGGadget27 = {
  505.   &MPXGGadget26, 320, 50, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  506.   (APTR)&MPXGImage27, NULL, &MPXGText27, NULL, (APTR)&MPXGGadget27Info, ATTACK_GADGET, NULL };
  507.  
  508. // DECAY Gadget
  509. struct PropInfo MPXGGadget28Info = {
  510.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  511. struct Image MPXGImage28 = {
  512.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  513. struct IntuiText MPXGText28 = {
  514.   2, 0, JAM1, -63, 1, NULL, "Decay  ", NULL };
  515. struct Gadget MPXGGadget28 = {
  516.   &MPXGGadget27, 320, 60, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  517.   (APTR)&MPXGImage28, NULL, &MPXGText28, NULL, (APTR)&MPXGGadget28Info, DECAY_GADGET, NULL };
  518.  
  519. // RELEASE Gadget
  520. struct PropInfo MPXGGadget29Info = {
  521.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  522. struct Image MPXGImage29 = {
  523.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  524. struct IntuiText MPXGText29 = {
  525.   2, 0, JAM1, -63, 1, NULL, "Release", NULL };
  526. struct Gadget MPXGGadget29 = {
  527.   &MPXGGadget28, 320, 70, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  528.   (APTR)&MPXGImage29, NULL, &MPXGText29, NULL, (APTR)&MPXGGadget29Info, RELEASE_GADGET, NULL };
  529.  
  530. // VXON Gadget
  531.  
  532. UBYTE boolchar[] = {"-"};
  533. struct IntuiText MPXGIText30 = { 4, 0, JAM1, 0, 0, NULL, boolchar, NULL };
  534.  
  535. struct Gadget MPXGGadget30 = {
  536.   &MPXGGadget29,58,191,8,7,GFLG_GADGHBOX|GFLG_GADGHIMAGE,GADGIMMEDIATE|RELVERIFY|TOGGLESELECT,
  537.   BOOLGADGET,NULL,NULL,&MPXGIText30,NULL,NULL,VXON_GADGET,NULL
  538. };
  539.  
  540. // TUNEC Gadget
  541. struct PropInfo MPXGGadget31Info = {
  542.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  543. struct Image MPXGImage31 = {
  544.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  545. struct IntuiText MPXGText31 = {
  546.   2, 0, JAM1, -63, 1, NULL, "Tune C ", NULL };
  547. struct Gadget MPXGGadget31 = {
  548.   &MPXGGadget30, 320, 130, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  549.   (APTR)&MPXGImage31, NULL, &MPXGText31, NULL, (APTR)&MPXGGadget31Info, TUNEC_GADGET, NULL };
  550.  
  551. // TUNEC# Gadget
  552. struct PropInfo MPXGGadget32Info = {
  553.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  554. struct Image MPXGImage32 = {
  555.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  556. struct IntuiText MPXGText32 = {
  557.   2, 0, JAM1, -63, 1, NULL, "Tune C#", NULL };
  558. struct Gadget MPXGGadget32 = {
  559.   &MPXGGadget31, 320, 140, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  560.   (APTR)&MPXGImage32, NULL, &MPXGText32, NULL, (APTR)&MPXGGadget32Info, TUNECIS_GADGET, NULL };
  561.  
  562. // TUNED Gadget
  563. struct PropInfo MPXGGadget33Info = {
  564.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  565. struct Image MPXGImage33 = {
  566.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  567. struct IntuiText MPXGText33 = {
  568.   2, 0, JAM1, -63, 1, NULL, "Tune D ", NULL };
  569. struct Gadget MPXGGadget33 = {
  570.   &MPXGGadget32, 320, 150, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  571.   (APTR)&MPXGImage33, NULL, &MPXGText33, NULL, (APTR)&MPXGGadget33Info, TUNED_GADGET, NULL };
  572.  
  573. // TUNED# Gadget
  574. struct PropInfo MPXGGadget34Info = {
  575.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  576. struct Image MPXGImage34 = {
  577.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  578. struct IntuiText MPXGText34 = {
  579.   2, 0, JAM1, -63, 1, NULL, "Tune D#", NULL };
  580. struct Gadget MPXGGadget34 = {
  581.   &MPXGGadget33, 320, 160, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  582.   (APTR)&MPXGImage34, NULL, &MPXGText34, NULL, (APTR)&MPXGGadget34Info, TUNEDIS_GADGET, NULL };
  583.  
  584. // TUNEE Gadget
  585. struct PropInfo MPXGGadget35Info = {
  586.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  587. struct Image MPXGImage35 = {
  588.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  589. struct IntuiText MPXGText35 = {
  590.   2, 0, JAM1, -63, 1, NULL, "Tune E ", NULL };
  591. struct Gadget MPXGGadget35 = {
  592.   &MPXGGadget34, 320, 170, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  593.   (APTR)&MPXGImage35, NULL, &MPXGText35, NULL, (APTR)&MPXGGadget35Info, TUNEE_GADGET, NULL };
  594.  
  595. // TUNEF Gadget
  596. struct PropInfo MPXGGadget36Info = {
  597.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  598. struct Image MPXGImage36 = {
  599.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  600. struct IntuiText MPXGText36 = {
  601.   2, 0, JAM1, -63, 1, NULL, "Tune F ", NULL };
  602. struct Gadget MPXGGadget36 = {
  603.   &MPXGGadget35, 320, 180, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  604.   (APTR)&MPXGImage36, NULL, &MPXGText36, NULL, (APTR)&MPXGGadget36Info, TUNEF_GADGET, NULL };
  605.  
  606. // TUNEF# Gadget
  607. struct PropInfo MPXGGadget37Info = {
  608.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  609. struct Image MPXGImage37 = {
  610.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  611. struct IntuiText MPXGText37 = {
  612.   2, 0, JAM1, -63, 1, NULL, "Tune F#", NULL };
  613. struct Gadget MPXGGadget37 = {
  614.   &MPXGGadget36, 320, 190, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  615.   (APTR)&MPXGImage37, NULL, &MPXGText37, NULL, (APTR)&MPXGGadget37Info, TUNEFIS_GADGET, NULL };
  616.  
  617. // TUNEG Gadget
  618. struct PropInfo MPXGGadget38Info = {
  619.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  620. struct Image MPXGImage38 = {
  621.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  622. struct IntuiText MPXGText38 = {
  623.   2, 0, JAM1, -63, 1, NULL, "Tune G ", NULL };
  624. struct Gadget MPXGGadget38 = {
  625.   &MPXGGadget37, 320, 200, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  626.   (APTR)&MPXGImage38, NULL, &MPXGText38, NULL, (APTR)&MPXGGadget38Info, TUNEG_GADGET, NULL };
  627.  
  628. // TUNEG# Gadget
  629. struct PropInfo MPXGGadget39Info = {
  630.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  631. struct Image MPXGImage39 = {
  632.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  633. struct IntuiText MPXGText39 = {
  634.   2, 0, JAM1, -63, 1, NULL, "Tune G#", NULL };
  635. struct Gadget MPXGGadget39 = {
  636.   &MPXGGadget38, 320, 210, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  637.   (APTR)& MPXGImage39, NULL, &MPXGText39, NULL, (APTR)&MPXGGadget39Info, TUNEGIS_GADGET, NULL };
  638.  
  639. // TUNEA Gadget
  640. struct PropInfo MPXGGadget40Info = {
  641.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  642. struct Image MPXGImage40 = {
  643.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  644. struct IntuiText MPXGText40 = {
  645.   2, 0, JAM1, -63, 1, NULL, "Tune A ", NULL };
  646. struct Gadget MPXGGadget40 = {
  647.   &MPXGGadget39, 320, 220, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  648.   (APTR)&MPXGImage40, NULL, &MPXGText40, NULL, (APTR)&MPXGGadget40Info, TUNEA_GADGET, NULL };
  649.  
  650. // TUNEA# Gadget
  651. struct PropInfo MPXGGadget41Info = {
  652.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  653. struct Image MPXGImage41 = {
  654.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  655. struct IntuiText MPXGText41 = {
  656.   2, 0, JAM1, -63, 1, NULL, "Tune A#", NULL };
  657. struct Gadget MPXGGadget41 = {
  658.   &MPXGGadget40, 320, 230, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  659.   (APTR)&MPXGImage41, NULL, &MPXGText41, NULL, (APTR)&MPXGGadget41Info, TUNEAIS_GADGET, NULL };
  660.  
  661. // TUNEB Gadget
  662. struct PropInfo MPXGGadget42Info = {
  663.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  664. struct Image MPXGImage42 = {
  665.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  666. struct IntuiText MPXGText42 = {
  667.   2, 0, JAM1, -63, 1, NULL, "Tune B ", NULL };
  668. struct Gadget MPXGGadget42 = {
  669.   &MPXGGadget41, 320, 240, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  670.   (APTR)&MPXGImage42, NULL, &MPXGText42, NULL, (APTR)&MPXGGadget42Info, TUNEB_GADGET, NULL };
  671.  
  672. // PINILVL Gadget
  673. struct PropInfo MPXGGadget43Info = {
  674.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  675. struct Image MPXGImage43 = {
  676.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  677. struct IntuiText MPXGText43 = {
  678.   2, 0, JAM1, -63, 1, NULL, "PIniLvl", NULL };
  679. struct Gadget MPXGGadget43 = {
  680.   &MPXGGadget42, 320, 80, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  681.   (APTR)& MPXGImage43, NULL, &MPXGText43, NULL, (APTR)&MPXGGadget43Info, PINILVL_GADGET, NULL };
  682.  
  683. // PATTACK Gadget
  684. struct PropInfo MPXGGadget44Info = {
  685.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  686. struct Image MPXGImage44 = {
  687.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  688. struct IntuiText MPXGText44 = {
  689.   2, 0, JAM1, -63, 1, NULL, "PAttack", NULL };
  690. struct Gadget MPXGGadget44 = {
  691.   &MPXGGadget43, 320, 90, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  692.   (APTR)&MPXGImage44, NULL, &MPXGText44, NULL, (APTR)&MPXGGadget44Info, PATTACK_GADGET, NULL };
  693.  
  694. // PRELLVL Gadget
  695. struct PropInfo MPXGGadget45Info = {
  696.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  697. struct Image MPXGImage45 = {
  698.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  699. struct IntuiText MPXGText45 = {
  700.   2, 0, JAM1, -63, 1, NULL, "PRelLvl", NULL };
  701. struct Gadget MPXGGadget45 = {
  702.   &MPXGGadget44, 320, 100, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  703.   (APTR)&MPXGImage45, NULL, &MPXGText45, NULL, (APTR)&MPXGGadget45Info, PRELLVL_GADGET, NULL };
  704.  
  705. // PRELTIM Gadget
  706. struct PropInfo MPXGGadget46Info = {
  707.   AUTOKNOB+FREEHORIZ, 0,  -1, MAXBODY * 1/128,  -1, };
  708. struct Image MPXGImage46 = {
  709.   0, 0, 102, 6, 0, NULL, 0x0000, 0x0000, NULL };
  710. struct IntuiText MPXGText46 = {
  711.   2, 0, JAM1, -63, 1, NULL, "PRelTim", NULL };
  712. struct Gadget MPXGGadget46 = {
  713.   &MPXGGadget45, 320, 110, 135, 8, GFLG_GADGHBOX|GFLG_GADGHIMAGE, RELVERIFY|GADGIMMEDIATE, PROPGADGET,
  714.   (APTR)&MPXGImage46, NULL, &MPXGText46, NULL, (APTR)&MPXGGadget46Info, PRELTIM_GADGET, NULL };
  715.  
  716. /* Write gadget. */
  717. struct IntuiText MPXGIText47 = {
  718.   4,0,JAM1,4,2,NULL,"Write",NULL
  719.   };
  720. struct Gadget MPXGGadget47 = {
  721.   &MPXGGadget46,320, 20, 50,11,GFLG_GADGHBOX|GFLG_GADGHIMAGE,RELVERIFY|GADGIMMEDIATE,BOOLGADGET,
  722.   (APTR)NULL,NULL,&MPXGIText47,NULL,NULL,WRITE_GADGET,NULL
  723.   };
  724.  
  725. /* Default gadget. */
  726. struct IntuiText MPXGIText48 = {
  727.   4,0,JAM1,4,2,NULL,"Default",NULL
  728.   };
  729. struct Gadget MPXGGadget48 = {
  730.   &MPXGGadget47,390, 20, 65,11,GFLG_GADGHBOX|GFLG_GADGHIMAGE,RELVERIFY|GADGIMMEDIATE,BOOLGADGET,
  731.   (APTR)NULL,NULL,&MPXGIText48,NULL,NULL,DEFAULT_GADGET,NULL
  732.   };
  733.  
  734.  
  735. //the mainwindowstructure
  736. struct NewWindow MPXGNewWindowStructure1 = {
  737.   0, 10,
  738.   500,  260,
  739.   0, 6,
  740.   GADGETDOWN|GADGETUP|CLOSEWINDOW,
  741.   WINDOWDRAG|WINDOWDEPTH|WINDOWCLOSE|ACTIVATE|NOCAREREFRESH,
  742.   &MPXGGadget48,
  743.   NULL,
  744.   "XG Multipart Editor",
  745.   NULL,
  746.   NULL,
  747.   5, 5,
  748.   -1, -1,
  749.   CUSTOMSCREEN
  750. };
  751.  
  752. extern struct ExecBase * SysBase;
  753. UBYTE p,  prgrm,  banknr, votyres=0, ins=0;
  754.  
  755. struct MPXGTool {
  756.   struct Tool tool;
  757.  
  758.   UBYTE voicetyp;
  759.   UBYTE bank;
  760.   UBYTE program;
  761.   UBYTE midichan;
  762.   UBYTE part;
  763.   UBYTE monopoly;
  764.   UBYTE keyas;
  765.   UBYTE noteshift;
  766.   UBYTE detuner;
  767.   UBYTE detunef;
  768.   UBYTE volume;
  769.   UBYTE velsdepth;
  770.   UBYTE velsoffset;
  771.   UBYTE velihigh;
  772.   UBYTE pan;
  773.   UBYTE notelihigh;
  774.   UBYTE notelilow;
  775.   UBYTE dry;
  776.   UBYTE chorus;
  777.   UBYTE reverb;
  778.   UBYTE varfx;
  779.   UBYTE vibrate;
  780.   UBYTE vibdepth;
  781.   UBYTE vibdelay;
  782.   UBYTE ficutoffreq;
  783.   UBYTE ficutoffreson;
  784.   UBYTE attack;
  785.   UBYTE decay;
  786.   UBYTE release;
  787.   UBYTE vxon;
  788.   UBYTE tunec;
  789.   UBYTE tunecis;
  790.   UBYTE tuned;
  791.   UBYTE tunedis;
  792.   UBYTE tunee;
  793.   UBYTE tunef;
  794.   UBYTE tunefis;
  795.   UBYTE tuneg;
  796.   UBYTE tunegis;
  797.   UBYTE tunea;
  798.   UBYTE tuneais;
  799.   UBYTE tuneb;
  800.   UBYTE pinilvl;
  801.   UBYTE pattack;
  802.   UBYTE prellvl;
  803.   UBYTE preltim;
  804.  
  805.   UBYTE writesw[720];
  806.   UBYTE sliderstorage[720];
  807.  
  808.   char *voicetypsysex;
  809.   char *banksysex;
  810.   char *programsysex;
  811.   char *midichansysex;
  812.   char *partsysex;
  813.   char *monopolysysex;
  814.   char *keyassysex;
  815.   char *noteshiftsysex;
  816.   char *detunersysex;
  817.   char *detunefsysex;
  818.   char *volumesysex;
  819.   char *velsdepthsysex;
  820.   char *velsoffsetsysex;
  821.   char *velihighsysex;
  822.   char *pansysex;
  823.   char *notelihighsysex;
  824.   char *notelilowsysex;
  825.   char *drysysex;
  826.   char *chorussysex;
  827.   char *reverbsysex;
  828.   char *varfxsysex;
  829.   char *vibratesysex;
  830.   char *vibdepthsysex;
  831.   char *vibdelaysysex;
  832.   char *ficutoffreqsysex;
  833.   char *ficutoffresonsysex;
  834.   char *attacksysex;
  835.   char *decaysysex;
  836.   char *releasesysex;
  837.   char *vxonsysex;
  838.   char *tunecsysex;
  839.   char *tunecissysex;
  840.   char *tunedsysex;
  841.   char *tunedissysex;
  842.   char *tuneesysex;
  843.   char *tunefsysex;
  844.   char *tunefissysex;
  845.   char *tunegsysex;
  846.   char *tunegissysex;
  847.   char *tuneasysex;
  848.   char *tuneaissysex;
  849.   char *tunebsysex;
  850.   char *pinilvlsysex;
  851.   char *pattacksysex;
  852.   char *prellvlsysex;
  853.   char *preltimsysex;
  854.  
  855. };
  856.  
  857. static struct ToolMaster master;
  858.  
  859. extern struct Functions *functions;
  860.  
  861. //initial values
  862. static void MPXG_tool_init(struct MPXGTool *tool)
  863. {
  864.   int b;
  865.  
  866.   tool->tool.touched = TOUCH_INIT;
  867.  
  868.   tool->voicetyp          = initstorage[0];
  869.   tool->bank              = initstorage[1];
  870.   tool->program           = initstorage[2];
  871.   tool->midichan          = initstorage[3];
  872.   tool->part              =  0;
  873.   tool->monopoly          = initstorage[4];
  874.   tool->keyas             = initstorage[5];
  875.   tool->noteshift         = initstorage[6];
  876.   tool->detuner           = initstorage[7];
  877.   tool->detunef           = initstorage[8];
  878.   tool->volume            = initstorage[9];
  879.   tool->velsdepth         = initstorage[10];
  880.   tool->velsoffset        = initstorage[11];
  881.   tool->velihigh          = initstorage[12];
  882.   tool->pan               = initstorage[13];
  883.   tool->notelihigh        = initstorage[14];
  884.   tool->notelilow         = initstorage[15];
  885.   tool->dry               = initstorage[16];
  886.   tool->chorus            = initstorage[17];
  887.   tool->reverb            = initstorage[18];
  888.   tool->varfx             = initstorage[19];
  889.   tool->vibrate           = initstorage[20];
  890.   tool->vibdepth          = initstorage[21];
  891.   tool->vibdelay          = initstorage[22];
  892.   tool->ficutoffreq       = initstorage[23];
  893.   tool->ficutoffreson     = initstorage[24];
  894.   tool->attack            = initstorage[25];
  895.   tool->decay             = initstorage[26];
  896.   tool->release           = initstorage[27];
  897.   tool->vxon              = initstorage[28];
  898.   tool->tunec             = initstorage[29];
  899.   tool->tunecis           = initstorage[30];
  900.   tool->tuned             = initstorage[31];
  901.   tool->tunedis           = initstorage[32];
  902.   tool->tunee             = initstorage[33];
  903.   tool->tunef             = initstorage[34];
  904.   tool->tunefis           = initstorage[35];
  905.   tool->tuneg             = initstorage[36];
  906.   tool->tunegis           = initstorage[37];
  907.   tool->tunea             = initstorage[38];
  908.   tool->tuneais           = initstorage[39];
  909.   tool->tuneb             = initstorage[40];
  910.   tool->pinilvl           = initstorage[41];
  911.   tool->pattack           = initstorage[42];
  912.   tool->prellvl           = initstorage[43];
  913.   tool->preltim           = initstorage[44];
  914.  
  915.  
  916.   tool->voicetypsysex      = NULL;
  917.   tool->banksysex          = NULL;
  918.   tool->programsysex       = NULL;
  919.   tool->midichansysex      = NULL;
  920.   tool->partsysex          = NULL;
  921.   tool->monopolysysex      = NULL;
  922.   tool->keyassysex         = NULL;
  923.   tool->noteshiftsysex     = NULL;
  924.   tool->detunersysex       = NULL;
  925.   tool->detunefsysex       = NULL;
  926.   tool->volumesysex        = NULL;
  927.   tool->velsdepthsysex     = NULL;
  928.   tool->velsoffsetsysex    = NULL;
  929.   tool->velihighsysex      = NULL;
  930.   tool->pansysex           = NULL;
  931.   tool->notelihighsysex    = NULL;
  932.   tool->notelilowsysex     = NULL;
  933.   tool->drysysex           = NULL;
  934.   tool->chorussysex        = NULL;
  935.   tool->reverbsysex        = NULL;
  936.   tool->varfxsysex         = NULL;
  937.   tool->vibratesysex       = NULL;
  938.   tool->vibdepthsysex      = NULL;
  939.   tool->vibdelaysysex      = NULL;
  940.   tool->ficutoffreqsysex   = NULL;
  941.   tool->ficutoffresonsysex = NULL;
  942.   tool->attacksysex        = NULL;
  943.   tool->decaysysex         = NULL;
  944.   tool->releasesysex       = NULL;
  945.   tool->vxonsysex          = NULL;
  946.   tool->tunecsysex         = NULL;
  947.   tool->tunecissysex       = NULL;
  948.   tool->tunedsysex         = NULL;
  949.   tool->tunedissysex       = NULL;
  950.   tool->tuneesysex         = NULL;
  951.   tool->tunefsysex         = NULL;
  952.   tool->tunefissysex       = NULL;
  953.   tool->tunegsysex         = NULL;
  954.   tool->tunegissysex       = NULL;
  955.   tool->tuneasysex         = NULL;
  956.   tool->tuneaissysex       = NULL;
  957.   tool->tunebsysex         = NULL;
  958.   tool->pinilvlsysex       = NULL;
  959.   tool->pattacksysex       = NULL;
  960.   tool->prellvlsysex       = NULL;
  961.   tool->preltimsysex       = NULL;
  962.  
  963.   for(b=0; b<720; b++)
  964.   {
  965.    tool->sliderstorage[b] = initstorage[b];
  966.    tool->writesw[b] = 0;
  967.   }
  968.  
  969. }
  970.  
  971.  
  972.  
  973. static struct Event * __saveds processeventcode(struct Event *event)
  974. {
  975.   event->tool = event->tool->next;
  976.   return(event);
  977. }
  978.  
  979. static BOOL lock_clip(struct Clip *clip)
  980. {
  981.   Forbid();
  982.   if (clip->locked == 0)
  983.     {
  984.       clip->locked = 1;
  985.       Permit();
  986.       return TRUE;
  987.     }
  988.   else
  989.     {
  990.       Permit();
  991.       return FALSE;
  992.     }
  993. }
  994.  
  995. static void unlock_clip(struct Clip *clip)
  996. {
  997.   clip->locked = 0;
  998. }
  999.  
  1000. //writes sysex into track
  1001.  
  1002. static void __saveds insertsysex(char *buff, short size, struct MPXGTool *tool,  const LONG time)
  1003. {
  1004.     struct StringEvent *event;
  1005.     struct String *string;
  1006.  
  1007.     event = (struct StringEvent *) (*functions->allocevent)();
  1008.      if (event)
  1009.       {
  1010.         string = (struct String *) (*functions->myalloc)(size + 3, MEMF_CLEAR);
  1011.         if (string)
  1012.         {
  1013.             event->next = NULL;
  1014.             event->string = string;
  1015.             memcpy(string->string,  buff,  size);
  1016.             string->length = size + 2;
  1017.             event->type = EVENT_SYSX;
  1018.             event->status = MIDI_SYSX;
  1019.             event->time = time;
  1020.             event->tool = tool->tool.next;
  1021.             if (lock_clip(&(tool->tool.track->clip)))
  1022.               {
  1023.                 event->next = (struct StringEvent *)tool->tool.track->clip.events.first;
  1024.                 tool->tool.track->clip.events.first = (struct Event *)(*functions->sorteventlist)(event);
  1025.                 unlock_clip(&(tool->tool.track->clip));
  1026.               }
  1027.             else
  1028.               {
  1029.                 (*functions->freelist)(event);
  1030.               }
  1031.  
  1032.         }
  1033.       }
  1034.  
  1035. }
  1036.  
  1037. // the routine for sending SysEx-data thru the pipeline
  1038.  
  1039. static void __saveds sendsysex(char *buff,  short size,  struct MPXGTool *tool,  const LONG time)
  1040. {
  1041.     struct StringEvent *event;
  1042.     struct String *string;
  1043.  
  1044.     event = (struct StringEvent *) (*functions->allocevent)();
  1045.      if (event)
  1046.       {
  1047.         string = (struct String *) (*functions->myalloc)(size + 3, MEMF_CLEAR);
  1048.         if (string)
  1049.         {
  1050.             event->string = string;
  1051.             memcpy(string->string,  buff,  size);
  1052.             string->length = size + 2;
  1053.             event->type = EVENT_SYSX;
  1054.             event->status = MIDI_SYSX;
  1055.             event->time = time;
  1056.             event->tool = tool->tool.next;
  1057.             WaitTOF();
  1058.             (*functions->qevent)(event);
  1059.             (*functions->myfree)(string);
  1060.         }
  1061.       }
  1062.  
  1063. }
  1064.  
  1065. static void __saveds trans_hx(struct MPXGTool *tool,  const LONG time,  char *sysx, int sw)
  1066. {
  1067.   LONG size;
  1068.   int a,  b,  x,  y ;
  1069.   UBYTE abuf[32];
  1070.   char chr[4];
  1071.   char *zbuf = NULL;
  1072.   struct Event *sysx_event;
  1073.  
  1074.     //translate sysexbuffer into hex
  1075.  
  1076.   size = strlen(sysx);
  1077.   zbuf = (char *)AllocVec(size+2,  MEMF_ANY|MEMF_CLEAR);
  1078.   if(zbuf)
  1079.      {
  1080.        CopyMem(sysx,  zbuf,  size);
  1081.        b=0;
  1082.        for(a=0;a < size;a=a+2)
  1083.            {
  1084.              chr[0] = zbuf[a];
  1085.              chr[1] = zbuf[a+1];
  1086.  
  1087.              x=(isdigit((int)chr[0]))? (chr[0]&0xF) : ((chr[0]&0xDF)-55); //this is the
  1088.              y=(isdigit((int)chr[1]))? (chr[1]&0xF) : ((chr[1]&0xDF)-55); //the translate-core
  1089.  
  1090.              abuf[b++] = ((x<<4)|y);   //writing with bitmanipulation
  1091.             }
  1092.       //send hexdata
  1093.  
  1094.        FreeVec(zbuf);
  1095.        if (sw == 0) sendsysex(abuf,  b,  tool,  time);
  1096.        if (sw == 1) insertsysex(abuf,  b,  tool,  time);
  1097.  
  1098.      }
  1099.  
  1100. }
  1101.  
  1102. //to put all the sliders to the value, that's stored
  1103. void initslider(struct MPXGTool *tool, struct Window *window)
  1104. {
  1105.   int i, b, a = (tool->part)*45;
  1106.  
  1107.   tool->voicetyp          = tool->sliderstorage[0+a];
  1108.   tool->bank              = tool->sliderstorage[1+a];
  1109.   tool->program           = tool->sliderstorage[2+a];
  1110.   tool->midichan          = tool->sliderstorage[3+a];
  1111.   tool->monopoly          = tool->sliderstorage[4+a];
  1112.   tool->keyas             = tool->sliderstorage[5+a];
  1113.   tool->noteshift         = tool->sliderstorage[6+a];
  1114.   tool->detuner           = tool->sliderstorage[7+a];
  1115.   tool->detunef           = tool->sliderstorage[8+a];
  1116.   tool->volume            = tool->sliderstorage[9+a];
  1117.   tool->velsdepth         = tool->sliderstorage[10+a];
  1118.   tool->velsoffset        = tool->sliderstorage[11+a];
  1119.   tool->velihigh          = tool->sliderstorage[12+a];
  1120.   tool->pan               = tool->sliderstorage[13+a];
  1121.   tool->notelihigh        = tool->sliderstorage[14+a];
  1122.   tool->notelilow         = tool->sliderstorage[15+a];
  1123.   tool->dry               = tool->sliderstorage[16+a];
  1124.   tool->chorus            = tool->sliderstorage[17+a];
  1125.   tool->reverb            = tool->sliderstorage[18+a];
  1126.   tool->varfx             = tool->sliderstorage[19+a];
  1127.   tool->vibrate           = tool->sliderstorage[20+a];
  1128.   tool->vibdepth          = tool->sliderstorage[21+a];
  1129.   tool->vibdelay          = tool->sliderstorage[22+a];
  1130.   tool->ficutoffreq       = tool->sliderstorage[23+a];
  1131.   tool->ficutoffreson     = tool->sliderstorage[24+a];
  1132.   tool->attack            = tool->sliderstorage[25+a];
  1133.   tool->decay             = tool->sliderstorage[26+a];
  1134.   tool->release           = tool->sliderstorage[27+a];
  1135.   tool->vxon              = tool->sliderstorage[28+a];
  1136.   tool->tunec             = tool->sliderstorage[29+a];
  1137.   tool->tunecis           = tool->sliderstorage[30+a];
  1138.   tool->tuned             = tool->sliderstorage[31+a];
  1139.   tool->tunedis           = tool->sliderstorage[32+a];
  1140.   tool->tunee             = tool->sliderstorage[33+a];
  1141.   tool->tunef             = tool->sliderstorage[34+a];
  1142.   tool->tunefis           = tool->sliderstorage[35+a];
  1143.   tool->tuneg             = tool->sliderstorage[36+a];
  1144.   tool->tunegis           = tool->sliderstorage[37+a];
  1145.   tool->tunea             = tool->sliderstorage[38+a];
  1146.   tool->tuneais           = tool->sliderstorage[39+a];
  1147.   tool->tuneb             = tool->sliderstorage[40+a];
  1148.   tool->pinilvl           = tool->sliderstorage[41+a];
  1149.   tool->pattack           = tool->sliderstorage[42+a];
  1150.   tool->prellvl           = tool->sliderstorage[43+a];
  1151.   tool->preltim           = tool->sliderstorage[44+a];
  1152.  
  1153.   (*functions->ModifyEmbossedProp)(window,  VOICETYP_GADGET,    tool->voicetyp, 0,  0,  0,  0,  0);
  1154.   (*functions->ModifyEmbossedProp)(window,  BANK_GADGET,        tool->bank,  0,  0,  0,  0,  0);
  1155.   (*functions->ModifyEmbossedProp)(window,  PROGRAM_GADGET,     tool->program,  0,  0,  0,  0,  0);
  1156.   (*functions->ModifyEmbossedProp)(window,  MIDICHAN_GADGET,    tool->midichan,  0,  0,  0,  0,  0);
  1157.   (*functions->ModifyEmbossedProp)(window,  MONOPOLY_GADGET,    tool->monopoly,  0,  0,  0,  0,  0);
  1158.   (*functions->ModifyEmbossedProp)(window,  KEYAS_GADGET,       tool->keyas,  0,  0,  0,  0,  0);
  1159.   (*functions->ModifyEmbossedProp)(window,  NOTESHIFT_GADGET,   tool->noteshift,  0,  0,  0,  0,  0);
  1160.   (*functions->ModifyEmbossedProp)(window,  DETUNER_GADGET,     tool->detuner,  0,  0,  0,  0,  0);
  1161.   (*functions->ModifyEmbossedProp)(window,  DETUNEF_GADGET,     tool->detunef,  0,  0,  0,  0,  0);
  1162.   (*functions->ModifyEmbossedProp)(window,  VOLUME_GADGET,      tool->volume,  0,  0,  0,  0,  0);
  1163.   (*functions->ModifyEmbossedProp)(window,  VELSDEPTH_GADGET,   tool->velsdepth,  0,  0,  0,  0,  0);
  1164.   (*functions->ModifyEmbossedProp)(window,  VELSOFFSET_GADGET,  tool->velsoffset,  0,  0,  0,  0,  0);
  1165.   (*functions->ModifyEmbossedProp)(window,  VELIHIGH_GADGET,    tool->velihigh,  0,  0,  0,  0,  0);
  1166.   (*functions->ModifyEmbossedProp)(window,  PAN_GADGET,         tool->pan,  0,  0,  0,  0,  0);
  1167.   (*functions->ModifyEmbossedProp)(window,  NOTELIHIGH_GADGET,  tool->notelihigh,  0,  0,  0,  0,  0);
  1168.   (*functions->ModifyEmbossedProp)(window,  NOTELILOW_GADGET,   tool->notelilow,  0,  0,  0,  0,  0);
  1169.   (*functions->ModifyEmbossedProp)(window,  DRY_GADGET,         tool->dry,  0,  0,  0,  0,  0);
  1170.   (*functions->ModifyEmbossedProp)(window,  CHORUS_GADGET,      tool->chorus,  0,  0,  0,  0,  0);
  1171.   (*functions->ModifyEmbossedProp)(window,  REVERB_GADGET,      tool->reverb,  0,  0,  0,  0,  0);
  1172.   (*functions->ModifyEmbossedProp)(window,  VARFX_GADGET,       tool->varfx,  0,  0,  0,  0,  0);
  1173.   (*functions->ModifyEmbossedProp)(window,  VIBRATE_GADGET,     tool->vibrate,  0,  0,  0,  0,  0);
  1174.   (*functions->ModifyEmbossedProp)(window,  VIBDEPTH_GADGET,    tool->vibdepth,  0,  0,  0,  0,  0);
  1175.   (*functions->ModifyEmbossedProp)(window,  VIBDELAY_GADGET,    tool->vibdelay,  0,  0,  0,  0,  0);
  1176.   (*functions->ModifyEmbossedProp)(window,  FICUTOFFREQ_GADGET, tool->ficutoffreq,  0,  0,  0,  0,  0);
  1177.   (*functions->ModifyEmbossedProp)(window,  FICUTOFFRESON_GADGET,  tool->ficutoffreson,  0,  0,  0,  0,  0);
  1178.   (*functions->ModifyEmbossedProp)(window,  ATTACK_GADGET,      tool->attack,  0,  0,  0,  0,  0);
  1179.   (*functions->ModifyEmbossedProp)(window,  DECAY_GADGET,       tool->decay,  0,  0,  0,  0,  0);
  1180.   (*functions->ModifyEmbossedProp)(window,  RELEASE_GADGET,     tool->release,  0,  0,  0,  0,  0);
  1181.   (*functions->ModifyEmbossedProp)(window,  TUNEC_GADGET,       tool->tunec,  0,  0,  0,  0,  0);
  1182.   (*functions->ModifyEmbossedProp)(window,  TUNECIS_GADGET,     tool->tunecis,  0,  0,  0,  0,  0);
  1183.   (*functions->ModifyEmbossedProp)(window,  TUNED_GADGET,       tool->tuned,  0,  0,  0,  0,  0);
  1184.   (*functions->ModifyEmbossedProp)(window,  TUNEDIS_GADGET,     tool->tunedis,  0,  0,  0,  0,  0);
  1185.   (*functions->ModifyEmbossedProp)(window,  TUNEE_GADGET,       tool->tunee,  0,  0,  0,  0,  0);
  1186.   (*functions->ModifyEmbossedProp)(window,  TUNEF_GADGET,       tool->tunef,  0,  0,  0,  0,  0);
  1187.   (*functions->ModifyEmbossedProp)(window,  TUNEFIS_GADGET,     tool->tunefis,  0,  0,  0,  0,  0);
  1188.   (*functions->ModifyEmbossedProp)(window,  TUNEG_GADGET,       tool->tuneg,  0,  0,  0,  0,  0);
  1189.   (*functions->ModifyEmbossedProp)(window,  TUNEGIS_GADGET,     tool->tunegis,  0,  0,  0,  0,  0);
  1190.   (*functions->ModifyEmbossedProp)(window,  TUNEA_GADGET,       tool->tunea,  0,  0,  0,  0,  0);
  1191.   (*functions->ModifyEmbossedProp)(window,  TUNEAIS_GADGET,     tool->tuneais,  0,  0,  0,  0,  0);
  1192.   (*functions->ModifyEmbossedProp)(window,  TUNEB_GADGET,       tool->tuneb,  0,  0,  0,  0,  0);
  1193.   (*functions->ModifyEmbossedProp)(window,  PINILVL_GADGET,     tool->pinilvl,  0,  0,  0,  0,  0);
  1194.   (*functions->ModifyEmbossedProp)(window,  PATTACK_GADGET,     tool->pattack,  0,  0,  0,  0,  0);
  1195.   (*functions->ModifyEmbossedProp)(window,  PRELLVL_GADGET,     tool->prellvl,  0,  0,  0,  0,  0);
  1196.   (*functions->ModifyEmbossedProp)(window,  PRELTIM_GADGET,     tool->preltim,  0,  0,  0,  0,  0);
  1197.  
  1198.  for (i= VOICETYP_GADGET; i<=RELEASE_GADGET ; i++)
  1199.      {
  1200.         (*functions->DrawEmbossedProp)(window,  i);
  1201.      }
  1202.  (*functions->SelectEmbossed)(window,VXON_GADGET, tool->vxon);
  1203.  
  1204.  for (i= TUNEC_GADGET; i<=PRELTIM_GADGET ; i++)
  1205.      {
  1206.         (*functions->DrawEmbossedProp)(window,  i);
  1207.      }
  1208. }
  1209.  
  1210. //to put all the sliders to the default values
  1211. void defaultslider(struct MPXGTool *tool, struct Window *window)
  1212. {
  1213.   int i, b;
  1214.   LONG time, a = (tool->part)*45;
  1215.   char storage1[32];
  1216.   char storage2[32];
  1217.   char storage3[32];
  1218.   char storage4[32];
  1219.   char storage5[32];
  1220.   char storage6[32];
  1221.   char storage7[32];
  1222.   char storage8[32];
  1223.   char storage9[32];
  1224.   char storage10[32];
  1225.   char storage11[32];
  1226.   char storage12[32];
  1227.   char storage13[32];
  1228.   char storage14[32];
  1229.   char storage15[32];
  1230.   char storage16[32];
  1231.   char storage17[32];
  1232.   char storage18[32];
  1233.   char storage19[32];
  1234.   char storage20[32];
  1235.   char storage21[32];
  1236.   char storage22[32];
  1237.   char storage23[32];
  1238.   char storage24[32];
  1239.   char storage25[32];
  1240.   char storage26[32];
  1241.   char storage27[32];
  1242.   char storage28[32];
  1243.   char storage29[32];
  1244.   char storage30[32];
  1245.   char storage31[32];
  1246.   char storage32[32];
  1247.   char storage33[32];
  1248.   char storage34[32];
  1249.   char storage35[32];
  1250.   char storage36[32];
  1251.   char storage37[32];
  1252.   char storage38[32];
  1253.   char storage39[32];
  1254.   char storage40[32];
  1255.   char storage41[32];
  1256.   char storage42[32];
  1257.   char storage43[32];
  1258.   char storage44[32];
  1259.   char storage45[32];
  1260.  
  1261.  
  1262.  
  1263.      tool->sliderstorage[0+a] = initstorage[0+a] =0;
  1264.      tool->sliderstorage[1+a] = initstorage[1+a] =0;
  1265.      tool->sliderstorage[2+a] = initstorage[2+a] =0;
  1266.      tool->sliderstorage[3+a] = initstorage[3+a] =0;
  1267.      tool->sliderstorage[4+a] = initstorage[4+a] =1;
  1268.      tool->sliderstorage[5+a] = initstorage[5+a] =1;
  1269.      tool->sliderstorage[6+a] = initstorage[6+a] =64;
  1270.      tool->sliderstorage[7+a] = initstorage[7+a] =8;
  1271.      tool->sliderstorage[8+a] = initstorage[8+a] =0;
  1272.      tool->sliderstorage[9+a] = initstorage[9+a] =100;
  1273.      tool->sliderstorage[10+a]= initstorage[10+a]=64;
  1274.      tool->sliderstorage[11+a]= initstorage[11+a]=64;
  1275.      tool->sliderstorage[12+a]= initstorage[12+a]=127;
  1276.      tool->sliderstorage[13+a]= initstorage[13+a]=64;
  1277.      tool->sliderstorage[14+a]= initstorage[14+a]=127;
  1278.      tool->sliderstorage[15+a]= initstorage[15+a]=0;
  1279.      tool->sliderstorage[16+a]= initstorage[16+a]=127;
  1280.      tool->sliderstorage[17+a]= initstorage[17+a]=0;
  1281.      tool->sliderstorage[18+a]= initstorage[18+a]=40;
  1282.      tool->sliderstorage[19+a]= initstorage[19+a]=0;
  1283.      tool->sliderstorage[20+a]= initstorage[20+a]=64;
  1284.      tool->sliderstorage[21+a]= initstorage[21+a]=64;
  1285.      tool->sliderstorage[22+a]= initstorage[22+a]=64;
  1286.      tool->sliderstorage[23+a]= initstorage[23+a]=64;
  1287.      tool->sliderstorage[24+a]= initstorage[24+a]=64;
  1288.      tool->sliderstorage[25+a]= initstorage[25+a]=64;
  1289.      tool->sliderstorage[26+a]= initstorage[26+a]=64;
  1290.      tool->sliderstorage[27+a]= initstorage[27+a]=64;
  1291.      tool->sliderstorage[28+a]= initstorage[28+a]=0;
  1292.      tool->sliderstorage[29+a]= initstorage[29+a]=64;
  1293.      tool->sliderstorage[30+a]= initstorage[30+a]=64;
  1294.      tool->sliderstorage[31+a]= initstorage[31+a]=64;
  1295.      tool->sliderstorage[32+a]= initstorage[32+a]=64;
  1296.      tool->sliderstorage[33+a]= initstorage[33+a]=64;
  1297.      tool->sliderstorage[34+a]= initstorage[34+a]=64;
  1298.      tool->sliderstorage[35+a]= initstorage[35+a]=64;
  1299.      tool->sliderstorage[36+a]= initstorage[36+a]=64;
  1300.      tool->sliderstorage[37+a]= initstorage[37+a]=64;
  1301.      tool->sliderstorage[38+a]= initstorage[38+a]=64;
  1302.      tool->sliderstorage[39+a]= initstorage[39+a]=64;
  1303.      tool->sliderstorage[40+a]= initstorage[40+a]=64;
  1304.      tool->sliderstorage[41+a]= initstorage[41+a]=64;
  1305.      tool->sliderstorage[42+a]= initstorage[42+a]=64;
  1306.      tool->sliderstorage[43+a]= initstorage[43+a]=64;
  1307.      tool->sliderstorage[44+a]= initstorage[44+a]=64;
  1308.  
  1309.   tool->voicetyp          = initstorage[0+a] ;
  1310.   tool->bank              = initstorage[1+a] ;
  1311.   tool->program           = initstorage[2+a] ;
  1312.   tool->midichan          = initstorage[3+a] ;
  1313.   tool->monopoly          = initstorage[4+a] ;
  1314.   tool->keyas             = initstorage[5+a] ;
  1315.   tool->noteshift         = initstorage[6+a] ;
  1316.   tool->detuner           = initstorage[7+a] ;
  1317.   tool->detunef           = initstorage[8+a] ;
  1318.   tool->volume            = initstorage[9+a] ;
  1319.   tool->velsdepth         = initstorage[10+a];
  1320.   tool->velsoffset        = initstorage[11+a];
  1321.   tool->velihigh          = initstorage[12+a];
  1322.   tool->pan               = initstorage[13+a];
  1323.   tool->notelihigh        = initstorage[14+a];
  1324.   tool->notelilow         = initstorage[15+a];
  1325.   tool->dry               = initstorage[16+a];
  1326.   tool->chorus            = initstorage[17+a];
  1327.   tool->reverb            = initstorage[18+a];
  1328.   tool->varfx             = initstorage[19+a];
  1329.   tool->vibrate           = initstorage[20+a];
  1330.   tool->vibdepth          = initstorage[21+a];
  1331.   tool->vibdelay          = initstorage[22+a];
  1332.   tool->ficutoffreq       = initstorage[23+a];
  1333.   tool->ficutoffreson     = initstorage[24+a];
  1334.   tool->attack            = initstorage[25+a];
  1335.   tool->decay             = initstorage[26+a];
  1336.   tool->release           = initstorage[27+a];
  1337.   tool->vxon              = initstorage[28+a];
  1338.   tool->tunec             = initstorage[29+a];
  1339.   tool->tunecis           = initstorage[30+a];
  1340.   tool->tuned             = initstorage[31+a];
  1341.   tool->tunedis           = initstorage[32+a];
  1342.   tool->tunee             = initstorage[33+a];
  1343.   tool->tunef             = initstorage[34+a];
  1344.   tool->tunefis           = initstorage[35+a];
  1345.   tool->tuneg             = initstorage[36+a];
  1346.   tool->tunegis           = initstorage[37+a];
  1347.   tool->tunea             = initstorage[38+a];
  1348.   tool->tuneais           = initstorage[39+a];
  1349.   tool->tuneb             = initstorage[40+a];
  1350.   tool->pinilvl           = initstorage[41+a];
  1351.   tool->pattack           = initstorage[42+a];
  1352.   tool->prellvl           = initstorage[43+a];
  1353.   tool->preltim           = initstorage[44+a];
  1354.  
  1355. for (b=0; b<=45; b++)
  1356.     {tool->writesw[a+b]=0;}
  1357.  
  1358.   (*functions->ModifyEmbossedProp)(window,  VOICETYP_GADGET,    tool->voicetyp, 0,  0,  0,  0,  0);
  1359.   (*functions->ModifyEmbossedProp)(window,  BANK_GADGET,        tool->bank,  0,  0,  0,  0,  0);
  1360.   (*functions->ModifyEmbossedProp)(window,  PROGRAM_GADGET,     tool->program,  0,  0,  0,  0,  0);
  1361.   (*functions->ModifyEmbossedProp)(window,  MIDICHAN_GADGET,    tool->midichan,  0,  0,  0,  0,  0);
  1362.   (*functions->ModifyEmbossedProp)(window,  MONOPOLY_GADGET,    tool->monopoly,  0,  0,  0,  0,  0);
  1363.   (*functions->ModifyEmbossedProp)(window,  KEYAS_GADGET,       tool->keyas,  0,  0,  0,  0,  0);
  1364.   (*functions->ModifyEmbossedProp)(window,  NOTESHIFT_GADGET,   tool->noteshift-0x28,  0,  0,  0,  0,  0);
  1365.   (*functions->ModifyEmbossedProp)(window,  DETUNER_GADGET,     tool->detuner,  0,  0,  0,  0,  0);
  1366.   (*functions->ModifyEmbossedProp)(window,  DETUNEF_GADGET,     tool->detunef,  0,  0,  0,  0,  0);
  1367.   (*functions->ModifyEmbossedProp)(window,  VOLUME_GADGET,      tool->volume,  0,  0,  0,  0,  0);
  1368.   (*functions->ModifyEmbossedProp)(window,  VELSDEPTH_GADGET,   tool->velsdepth,  0,  0,  0,  0,  0);
  1369.   (*functions->ModifyEmbossedProp)(window,  VELSOFFSET_GADGET,  tool->velsoffset,  0,  0,  0,  0,  0);
  1370.   (*functions->ModifyEmbossedProp)(window,  VELIHIGH_GADGET,    tool->velihigh,  0,  0,  0,  0,  0);
  1371.   (*functions->ModifyEmbossedProp)(window,  PAN_GADGET,         tool->pan,  0,  0,  0,  0,  0);
  1372.   (*functions->ModifyEmbossedProp)(window,  NOTELIHIGH_GADGET,  tool->notelihigh,  0,  0,  0,  0,  0);
  1373.   (*functions->ModifyEmbossedProp)(window,  NOTELILOW_GADGET,   tool->notelilow,  0,  0,  0,  0,  0);
  1374.   (*functions->ModifyEmbossedProp)(window,  DRY_GADGET,         tool->dry,  0,  0,  0,  0,  0);
  1375.   (*functions->ModifyEmbossedProp)(window,  CHORUS_GADGET,      tool->chorus,  0,  0,  0,  0,  0);
  1376.   (*functions->ModifyEmbossedProp)(window,  REVERB_GADGET,      tool->reverb,  0,  0,  0,  0,  0);
  1377.   (*functions->ModifyEmbossedProp)(window,  VARFX_GADGET,       tool->varfx,  0,  0,  0,  0,  0);
  1378.   (*functions->ModifyEmbossedProp)(window,  VIBRATE_GADGET,     tool->vibrate,  0,  0,  0,  0,  0);
  1379.   (*functions->ModifyEmbossedProp)(window,  VIBDEPTH_GADGET,    tool->vibdepth,  0,  0,  0,  0,  0);
  1380.   (*functions->ModifyEmbossedProp)(window,  VIBDELAY_GADGET,    tool->vibdelay,  0,  0,  0,  0,  0);
  1381.   (*functions->ModifyEmbossedProp)(window,  FICUTOFFREQ_GADGET, tool->ficutoffreq,  0,  0,  0,  0,  0);
  1382.   (*functions->ModifyEmbossedProp)(window,  FICUTOFFRESON_GADGET, tool->ficutoffreson,  0,  0,  0,  0,  0);
  1383.   (*functions->ModifyEmbossedProp)(window,  ATTACK_GADGET,      tool->attack,  0,  0,  0,  0,  0);
  1384.   (*functions->ModifyEmbossedProp)(window,  DECAY_GADGET,       tool->decay,  0,  0,  0,  0,  0);
  1385.   (*functions->ModifyEmbossedProp)(window,  RELEASE_GADGET,     tool->release,  0,  0,  0,  0,  0);
  1386.   (*functions->ModifyEmbossedProp)(window,  TUNEC_GADGET,       tool->tunec,  0,  0,  0,  0,  0);
  1387.   (*functions->ModifyEmbossedProp)(window,  TUNECIS_GADGET,     tool->tunecis,  0,  0,  0,  0,  0);
  1388.   (*functions->ModifyEmbossedProp)(window,  TUNED_GADGET,       tool->tuned,  0,  0,  0,  0,  0);
  1389.   (*functions->ModifyEmbossedProp)(window,  TUNEDIS_GADGET,     tool->tunedis,  0,  0,  0,  0,  0);
  1390.   (*functions->ModifyEmbossedProp)(window,  TUNEE_GADGET,       tool->tunee,  0,  0,  0,  0,  0);
  1391.   (*functions->ModifyEmbossedProp)(window,  TUNEF_GADGET,       tool->tunef,  0,  0,  0,  0,  0);
  1392.   (*functions->ModifyEmbossedProp)(window,  TUNEFIS_GADGET,     tool->tunefis,  0,  0,  0,  0,  0);
  1393.   (*functions->ModifyEmbossedProp)(window,  TUNEG_GADGET,       tool->tuneg,  0,  0,  0,  0,  0);
  1394.   (*functions->ModifyEmbossedProp)(window,  TUNEGIS_GADGET,     tool->tunegis,  0,  0,  0,  0,  0);
  1395.   (*functions->ModifyEmbossedProp)(window,  TUNEA_GADGET,       tool->tunea,  0,  0,  0,  0,  0);
  1396.   (*functions->ModifyEmbossedProp)(window,  TUNEAIS_GADGET,     tool->tuneais,  0,  0,  0,  0,  0);
  1397.   (*functions->ModifyEmbossedProp)(window,  TUNEB_GADGET,       tool->tuneb,  0,  0,  0,  0,  0);
  1398.   (*functions->ModifyEmbossedProp)(window,  PINILVL_GADGET,     tool->pinilvl,  0,  0,  0,  0,  0);
  1399.   (*functions->ModifyEmbossedProp)(window,  PATTACK_GADGET,     tool->pattack,  0,  0,  0,  0,  0);
  1400.   (*functions->ModifyEmbossedProp)(window,  PRELLVL_GADGET,     tool->prellvl,  0,  0,  0,  0,  0);
  1401.   (*functions->ModifyEmbossedProp)(window,  PRELTIM_GADGET,     tool->preltim,  0,  0,  0,  0,  0);
  1402.  
  1403.  for (i= VOICETYP_GADGET; i<=RELEASE_GADGET ; i++)
  1404.      {
  1405.         (*functions->DrawEmbossedProp)(window,  i);
  1406.      }
  1407.  
  1408.  (*functions->SelectEmbossed)(window,VXON_GADGET, tool->vxon);
  1409.  
  1410.  for (i= TUNEC_GADGET; i<=PRELTIM_GADGET ; i++)
  1411.      {
  1412.         (*functions->DrawEmbossedProp)(window,  i);
  1413.      }
  1414.               sprintf(storage1, "F043104C08%02lx01%02lxF7",tool->part,tool->voicetyp);
  1415.               tool->voicetypsysex = storage1;
  1416.               time = functions->timenow;
  1417.               trans_hx(tool,  time,  tool->voicetypsysex, 0);
  1418.  
  1419.               sprintf(storage2, "F043104C08%02lx02%02lxF7",tool->part,tool->bank);
  1420.               tool->banksysex = storage2;
  1421.               time = functions->timenow;
  1422.               trans_hx(tool,  time,  tool->banksysex, 0);
  1423.  
  1424.               sprintf(storage3, "F043104C08%02lx03%02lxF7",tool->part,tool->program);
  1425.               tool->programsysex = storage3;
  1426.               time = functions->timenow;
  1427.               trans_hx(tool,  time,  tool->programsysex, 0);
  1428.  
  1429.               sprintf(storage4, "F043104C08%02lx04%02lxF7",tool->part,tool->midichan);
  1430.               tool->midichansysex = storage4;
  1431.               time = functions->timenow;
  1432.               trans_hx(tool,  time,  tool->midichansysex, 0);
  1433.  
  1434.               sprintf(storage5, "F043104C08%02lx05%02lxF7",tool->part,tool->monopoly);
  1435.               tool->monopolysysex = storage5;
  1436.               time = functions->timenow;
  1437.               trans_hx(tool,  time,  tool->monopolysysex, 0);
  1438.  
  1439.               sprintf(storage6, "F043104C08%02lx06%02lxF7",tool->part,tool->keyas);
  1440.               tool->keyassysex  = storage6;
  1441.               time = functions->timenow;
  1442.               trans_hx(tool,  time,  tool->keyassysex, 0);
  1443.  
  1444.               sprintf(storage7, "F043104C08%02lx08%02lxF7",tool->part,tool->noteshift);
  1445.               tool->noteshiftsysex      = storage7;
  1446.               time = functions->timenow;
  1447.               trans_hx(tool,  time,  tool->noteshiftsysex, 0);
  1448.  
  1449.               sprintf(storage8, "F043104C08%02lx09%02lx%02lxF7",tool->part,tool->detuner,tool->detunef);
  1450.               tool->detunersysex        = storage8;
  1451.               time = functions->timenow;
  1452.               trans_hx(tool,  time,  tool->detunersysex, 0);
  1453.  
  1454.               sprintf(storage9, "F043104C08%02lx09%02lx%02lxF7",tool->part,tool->detuner,tool->detunef);
  1455.               tool->detunefsysex        = storage9;
  1456.               time = functions->timenow;
  1457.               trans_hx(tool,  time,  tool->detunefsysex, 0);
  1458.  
  1459.               sprintf(storage10, "F043104C08%02lx0B%02lxF7",tool->part,tool->volume);
  1460.               tool->volumesysex         = storage10;
  1461.               time = functions->timenow;
  1462.               trans_hx(tool,  time,  tool->volumesysex, 0);
  1463.  
  1464.               sprintf(storage11, "F043104C08%02lx0C%02lxF7",tool->part,tool->velsdepth);
  1465.               tool->velsdepthsysex      = storage11;
  1466.               time = functions->timenow;
  1467.               trans_hx(tool,  time,  tool->velsdepthsysex, 0);
  1468.  
  1469.               sprintf(storage12, "F043104C08%02lx0D%02lxF7",tool->part,tool->velsoffset);
  1470.               tool->velsoffsetsysex     = storage12;
  1471.               time = functions->timenow;
  1472.               trans_hx(tool,  time,  tool->velsoffsetsysex, 0);
  1473.  
  1474.               sprintf(storage13, "F043104C08%02lx6E%02lxF7",tool->part,tool->velihigh);
  1475.               tool->velihighsysex     = storage13;
  1476.               time = functions->timenow;
  1477.               trans_hx(tool,  time,  tool->velihighsysex, 0);
  1478.  
  1479.               sprintf(storage14, "F043104C08%02lx0E%02lxF7",tool->part,tool->pan);
  1480.               tool->pansysex     = storage14;
  1481.               time = functions->timenow;
  1482.               trans_hx(tool,  time,  tool->pansysex, 0);
  1483.  
  1484.               sprintf(storage15, "F043104C08%02lx10%02lxF7",tool->part,tool->notelihigh);
  1485.               tool->notelihighsysex     = storage15;
  1486.               time = functions->timenow;
  1487.               trans_hx(tool,  time,  tool->notelihighsysex, 0);
  1488.  
  1489.               sprintf(storage16, "F043104C08%02lx0F%02lxF7",tool->part,tool->notelilow);
  1490.               tool->notelilowsysex      = storage16;
  1491.               time = functions->timenow;
  1492.               trans_hx(tool,  time,  tool->notelilowsysex, 0);
  1493.  
  1494.               sprintf(storage17, "F043104C08%02lx11%02lxF7",tool->part,tool->dry);
  1495.               tool->drysysex     = storage17;
  1496.               time = functions->timenow;
  1497.               trans_hx(tool,  time,  tool->drysysex, 0);
  1498.  
  1499.               sprintf(storage18, "F043104C08%02lx12%02lxF7",tool->part,tool->chorus);
  1500.               tool->chorussysex         = storage18;
  1501.               time = functions->timenow;
  1502.               trans_hx(tool,  time,  tool->chorussysex, 0);
  1503.  
  1504.               sprintf(storage19, "F043104C08%02lx13%02lxF7",tool->part,tool->reverb);
  1505.               tool->reverbsysex         = storage19;
  1506.               time = functions->timenow;
  1507.               trans_hx(tool,  time,  tool->reverbsysex, 0);
  1508.  
  1509.               sprintf(storage20, "F043104C08%02lx14%02lxF7",tool->part,tool->varfx);
  1510.               tool->varfxsysex          = storage20;
  1511.               time = functions->timenow;
  1512.               trans_hx(tool,  time,  tool->varfxsysex, 0);
  1513.  
  1514.               sprintf(storage21, "F043104C08%02lx15%02lxF7",tool->part,tool->vibrate);
  1515.               tool->vibratesysex        = storage21;
  1516.               time = functions->timenow;
  1517.               trans_hx(tool,  time,  tool->vibratesysex, 0);
  1518.  
  1519.               sprintf(storage22, "F043104C08%02lx16%02lxF7",tool->part,tool->vibdepth);
  1520.               tool->vibdepthsysex       = storage22;
  1521.               time = functions->timenow;
  1522.               trans_hx(tool,  time,  tool->vibdepthsysex, 0);
  1523.  
  1524.               sprintf(storage23, "F043104C08%02lx17%02lxF7",tool->part,tool->vibdelay);
  1525.               tool->vibdelaysysex       = storage23;
  1526.               time = functions->timenow;
  1527.               trans_hx(tool,  time,  tool->vibdelaysysex, 0);
  1528.  
  1529.               sprintf(storage24, "F043104C08%02lx18%02lxF7",tool->part,tool->ficutoffreq);
  1530.               tool->ficutoffreqsysex    = storage24;
  1531.               time = functions->timenow;
  1532.               trans_hx(tool,  time,  tool->ficutoffreqsysex, 0);
  1533.  
  1534.               sprintf(storage25, "F043104C08%02lx19%02lxF7",tool->part,tool->ficutoffreson);
  1535.               tool->ficutoffresonsysex  = storage25;
  1536.               time = functions->timenow;
  1537.               trans_hx(tool,  time,  tool->ficutoffresonsysex, 0);
  1538.  
  1539.               sprintf(storage26, "F043104C08%02lx1A%02lxF7",tool->part,tool->attack);
  1540.               tool->attacksysex         = storage26;
  1541.               time = functions->timenow;
  1542.               trans_hx(tool,  time,  tool->attacksysex, 0);
  1543.  
  1544.               sprintf(storage27, "F043104C08%02lx1B%02lxF7",tool->part,tool->decay);
  1545.               tool->decaysysex          = storage27;
  1546.               time = functions->timenow;
  1547.               trans_hx(tool,  time,  tool->decaysysex, 0);
  1548.  
  1549.               sprintf(storage28, "F043104C08%02lx1C%02lxF7",tool->part,tool->release);
  1550.               tool->releasesysex        = storage28;
  1551.               time = functions->timenow;
  1552.               trans_hx(tool,  time,  tool->releasesysex, 0);
  1553.  
  1554.               sprintf(storage29, "F043104C02015A%02lxF7",tool->vxon);
  1555.               tool->vxonsysex           = storage29;
  1556.               time = functions->timenow;
  1557.               trans_hx(tool,  time,  tool->vxonsysex, 0);
  1558.  
  1559.               sprintf(storage30, "F043104C08%02lx41%02lxF7",tool->part,tool->tunec);
  1560.               tool->tunecsysex          = storage30;
  1561.               time = functions->timenow;
  1562.               trans_hx(tool,  time,  tool->tunecsysex, 0);
  1563.  
  1564.               sprintf(storage31, "F043104C08%02lx42%02lxF7",tool->part,tool->tunecis);
  1565.               tool->tunecissysex        = storage31;
  1566.               time = functions->timenow;
  1567.               trans_hx(tool,  time,  tool->tunecissysex, 0);
  1568.  
  1569.               sprintf(storage32, "F043104C08%02lx43%02lxF7",tool->part,tool->tuned);
  1570.               tool->tunedsysex          = storage32;
  1571.               time = functions->timenow;
  1572.               trans_hx(tool,  time,  tool->tunedsysex, 0);
  1573.  
  1574.               sprintf(storage33, "F043104C08%02lx44%02lxF7",tool->part,tool->tunedis);
  1575.               tool->tunedissysex        = storage33;
  1576.               time = functions->timenow;
  1577.               trans_hx(tool,  time,  tool->tunedissysex, 0);
  1578.  
  1579.               sprintf(storage34, "F043104C08%02lx45%02lxF7",tool->part,tool->tunee);
  1580.               tool->tuneesysex          = storage34;
  1581.               time = functions->timenow;
  1582.               trans_hx(tool,  time,  tool->tuneesysex, 0);
  1583.  
  1584.               sprintf(storage35, "F043104C08%02lx46%02lxF7",tool->part,tool->tunef);
  1585.               tool->tunefsysex          = storage35;
  1586.               time = functions->timenow;
  1587.               trans_hx(tool,  time,  tool->tunefsysex, 0);
  1588.  
  1589.               sprintf(storage36, "F043104C08%02lx47%02lxF7",tool->part,tool->tunefis);
  1590.               tool->tunefissysex        = storage36;
  1591.               time = functions->timenow;
  1592.               trans_hx(tool,  time,  tool->tunefissysex, 0);
  1593.  
  1594.               sprintf(storage37, "F043104C08%02lx48%02lxF7",tool->part,tool->tuneg);
  1595.               tool->tunegsysex          = storage37;
  1596.               time = functions->timenow;
  1597.               trans_hx(tool,  time,  tool->tunegsysex, 0);
  1598.  
  1599.               sprintf(storage38, "F043104C08%02lx49%02lxF7",tool->part,tool->tunegis);
  1600.               tool->tunegissysex        = storage38;
  1601.               time = functions->timenow;
  1602.               trans_hx(tool,  time,  tool->tunegissysex, 0);
  1603.  
  1604.               sprintf(storage39, "F043104C08%02lx4A%02lxF7",tool->part,tool->tunea);
  1605.               tool->tuneasysex          = storage39;
  1606.               time = functions->timenow;
  1607.               trans_hx(tool,  time,  tool->tuneasysex, 0);
  1608.  
  1609.               sprintf(storage40, "F043104C08%02lx4B%02lxF7",tool->part,tool->tuneais);
  1610.               tool->tuneaissysex        = storage40;
  1611.               time = functions->timenow;
  1612.               trans_hx(tool,  time,  tool->tuneaissysex, 0);
  1613.  
  1614.               sprintf(storage41, "F043104C08%02lx4C%02lxF7",tool->part,tool->tuneb);
  1615.               tool->tunebsysex          = storage41;
  1616.               time = functions->timenow;
  1617.               trans_hx(tool,  time,  tool->tunebsysex, 0);
  1618.  
  1619.               sprintf(storage42, "F043104C08%02lx69%02lxF7",tool->part,tool->pinilvl);
  1620.               tool->pinilvlsysex          = storage42;
  1621.               time = functions->timenow;
  1622.               trans_hx(tool,  time,  tool->pinilvlsysex, 0);
  1623.  
  1624.               sprintf(storage43, "F043104C08%02lx6A%02lxF7",tool->part,tool->pattack);
  1625.               tool->pattacksysex          = storage43;
  1626.               time = functions->timenow;
  1627.               trans_hx(tool,  time,  tool->pattacksysex, 0);
  1628.  
  1629.               sprintf(storage44, "F043104C08%02lx6B%02lxF7",tool->part,tool->prellvl);
  1630.               tool->prellvlsysex          = storage44;
  1631.               time = functions->timenow;
  1632.               trans_hx(tool,  time,  tool->prellvlsysex, 0);
  1633.  
  1634.               sprintf(storage45, "F043104C08%02lx6C%02lxF7",tool->part,tool->preltim);
  1635.               tool->preltimsysex          = storage45;
  1636.               time = functions->timenow;
  1637.               trans_hx(tool,  time,  tool->preltimsysex, 0);
  1638.  
  1639.  
  1640. }
  1641.  
  1642.  
  1643. // Writes all values of the sliders and more  in the main window
  1644.  
  1645. LONG __saveds display_routine(struct Window *window, struct Gadget *gadget, ULONG value)
  1646. {
  1647.   char text[10];
  1648.   char tname[32];
  1649.  
  1650.   char P01text[4];
  1651.   char varfx01text[4];
  1652.   const short id = gadget->GadgetID;
  1653.   struct RastPort *rp = window->RPort;
  1654.   char name[15];
  1655.   int  i=0;
  1656.   UBYTE swi;
  1657.  
  1658.   UBYTE sw[]={
  1659.    0, 1,42, 2,42,42,42,42,42,42,
  1660.   42,42,42,42,42,42, 3,42,42,42,
  1661.   42,42,42,42,42,42,42,42,42,42,
  1662.   42,42, 4, 5, 6, 7, 8, 9,42,42,
  1663.   42,42,42,42,42,42,42,42,10,11,
  1664.   12,42,42,42,13,14,42,42,42,42,
  1665.   42,42,42,42,15,16,17,18,19,20,
  1666.   21,42,42,42,42,42,42,42,42,42,
  1667.   22,23,24,25,26,27,28,29,30,31,
  1668.   32,42,42,42,42,42,33,34,35,36,
  1669.   37,42,42,42,42,42,42,42,42,42,
  1670.   42,42,38,39,40,41,42,42,42,42,
  1671.   42,42,42,42,42,42,42,42};
  1672.  
  1673.   char sfxvoice[43][11]=
  1674.   {
  1675.     "CuttngNoic1", "CuttngNoic2", "String Slap", "FluteKClick", "Rain       ",
  1676.     "Thunder    ", "Wind       ", "Stream     ", "Bubble     ", "Feed       ",
  1677.     "Dog        ", "Horse      ", "Bird 2     ", "Ghost      ", "Maou       ",
  1678.     "TelephnDial", "Door Squeak", "Door Slam  ", "Scratch 1  ", "Scratch 2  ",
  1679.     "Wind Chime ", "Telephon 2 ", "Car Engine ", "Car Stop   ", "Car Pass   ",
  1680.     "Car Crash  ", "Siren      ", "Train      ", "Jetplain   ", "Starship   ",
  1681.     "Burst      ", "Coaster    ", "Sub Marine ", "Laughing   ", "Scream     ",
  1682.     "Punch      ", "Heart      ", "Food Step  ", "Machine Gun", "Laser Gun  ",
  1683.     "Explosion  ", "Fire Work  ", "  «empty»  "
  1684.   };
  1685.  
  1686.   char noteli[128][4]={
  1687.   " C-2","C#-2"," D-2","D#-2"," E-2"," F-2","F#-2"," G-2","G#-2"," A-2","A#-2"," B-2",
  1688.   " C-1","C#-1"," D-1","D#-1"," E-1"," F-1","F#-1"," G-1","G#-1"," A-1","A#-1"," B-1",
  1689.   "  C0"," C#0","  D0"," D#0","  E0","  F0"," F#0","  G0"," G#0","  A0"," A#0","  B0",
  1690.   "  C1"," C#1","  D1"," D#1","  E1","  F1"," F#1","  G1"," G#1","  A1"," A#1","  B1",
  1691.   "  C2"," C#2","  D2"," D#2","  E2","  F2"," F#2","  G2"," G#2","  A2"," A#2","  B2",
  1692.   "  C3"," C#3","  D3"," D#3","  E3","  F3"," F#3","  G3"," G#3","  A3"," A#3","  B3",
  1693.   "  C4"," C#4","  D4"," D#4","  E4","  F4"," F#4","  G4"," G#4","  A4"," A#4","  B4",
  1694.   "  C5"," C#5","  D5"," D#5","  E5","  F5"," F#5","  G5"," G#5","  A5"," A#5","  B5",
  1695.   "  C6"," C#6","  D6"," D#6","  E6","  F6"," F#6","  G6"," G#6","  A6"," A#6","  B6",
  1696.   "  C7"," C#7","  D7"," D#7","  E7","  F7"," F#7","  G7"," G#7","  A7"," A#7","  B7",
  1697.   "  C8"," C#8","  D8"," D#8","  E8","  F8"," F#8","  G8"};
  1698.  
  1699.   char voicetyp[2][8]={"NormalVc","SFXVoice"};
  1700.   char mopo[2][4]={"Mono","Poly"};
  1701.   char keas[3][6]={"Single","Multi ","Inst  "};
  1702.   char vxon[2][3]={"off","on "};
  1703.   UBYTE voty[2] ={0,64};
  1704.  
  1705.   SetAPen(rp,  6);
  1706.   SetBPen(rp,  0);
  1707.   SetDrMd(rp,  JAM2);
  1708.  
  1709.          switch (id)
  1710.               {
  1711.               case VOICETYP_GADGET:
  1712.                 Move(rp,  51, 35);
  1713.                 sprintf(text,  "%.8s",  voicetyp[value]);
  1714.                 Text(rp,  text,  8);
  1715.                 value = voty[value];
  1716.                 if (value == 0) votyres = 0;
  1717.                 if (value == 64) votyres = 1;
  1718.                 break;
  1719.               case BANK_GADGET:
  1720.                 banknr = bnk[value];
  1721.                 sprintf(text,  "%3ld",  banknr);
  1722.                 Move(rp, 216,  58);
  1723.                 Text(rp,  text,  3);
  1724.                 break;
  1725.               case PROGRAM_GADGET:
  1726.                 prgrm = value;
  1727.                 Move(rp, 216,  68);
  1728.                 sprintf(text,  "%3ld",  prgrm);
  1729.                 Text(rp,  text,  3);
  1730.                 break;
  1731.               case MIDICHAN_GADGET:
  1732.                 Move(rp,  224,  23);
  1733.                 sprintf(text,  "%2ld",  value+1);
  1734.                 Text(rp,  text,  2);
  1735.                 break;
  1736.               case PART_GADGET:
  1737.                 Move(rp,  106,  23);
  1738.                 sprintf(text,  "%2ld",  value+1);
  1739.                 Text(rp,  text,  2);
  1740.                 break;
  1741.               case MONOPOLY_GADGET:
  1742.                 Move(rp,  143,  35);
  1743.                 sprintf(text,  "%.4s",  mopo[value]);
  1744.                 Text(rp,  text,  4);
  1745.                 break;
  1746.               case KEYAS_GADGET:
  1747.                 Move(rp,  200,  35);
  1748.                 sprintf(text,  "%.6s",  keas[value]);
  1749.                 Text(rp,  text,  6);
  1750.                 break;
  1751.              case NOTESHIFT_GADGET:
  1752.                 Move(rp, 216,  77);
  1753.                 sprintf(text,  "%3ld",  value + 0x28);
  1754.                 value = value + 0x28;
  1755.                 Text(rp,  text,  3);
  1756.                 break;
  1757.               case DETUNER_GADGET:
  1758.                 Move(rp,  100,  87);
  1759.                 sprintf(text,  "%2ld",  value);
  1760.                 Text(rp,  text,  2);
  1761.                 break;
  1762.               case DETUNEF_GADGET:
  1763.                 Move(rp, 216,  87);
  1764.                 sprintf(text,  "%3ld",  value);
  1765.                 Text(rp,  text,  3);
  1766.                 break;
  1767.               case VOLUME_GADGET:
  1768.                 Move(rp, 216,  97);
  1769.                 sprintf(text,  "%3ld",  value);
  1770.                 Text(rp,  text,  3);
  1771.                 break;
  1772.               case VELSDEPTH_GADGET:
  1773.                 Move(rp, 216,  107);
  1774.                 sprintf(text,  "%3ld",  value);
  1775.                 Text(rp,  text,  3);
  1776.                 break;
  1777.               case VELSOFFSET_GADGET:
  1778.                 Move(rp, 216,  117);
  1779.                 sprintf(text,  "%3ld",  value);
  1780.                 Text(rp,  text,  3);
  1781.                 break;
  1782.               case VELIHIGH_GADGET:
  1783.                 Move(rp, 216,  127);
  1784.                 sprintf(text,  "%3ld",  value);
  1785.                 Text(rp,  text,  3);
  1786.                 break;
  1787.               case PAN_GADGET:
  1788.                 Move(rp, 216,  137);
  1789.                 sprintf(text,  "%3ld",  value);
  1790.                 Text(rp,  text,  3);
  1791.                 break;
  1792.               case NOTELIHIGH_GADGET:
  1793.                 Move(rp, 208,  147);
  1794.                 sprintf(text,  "%.4s",  noteli[value]);
  1795.                 Text(rp,  text,  4);
  1796.                 break;
  1797.               case NOTELILOW_GADGET:
  1798.                 Move(rp, 208,  157);
  1799.                 sprintf(text,  "%.4s",  noteli[value]);
  1800.                 Text(rp,  text,  4);
  1801.                 break;
  1802.               case DRY_GADGET:
  1803.                 Move(rp, 216,  167);
  1804.                 sprintf(text,  "%3ld",  value);
  1805.                 Text(rp,  text,  3);
  1806.                 break;
  1807.               case CHORUS_GADGET:
  1808.                 Move(rp, 216,  177);
  1809.                 sprintf(text,  "%3ld",  value);
  1810.                 Text(rp,  text,  3);
  1811.                 break;
  1812.               case REVERB_GADGET:
  1813.                 Move(rp, 216,  187);
  1814.                 sprintf(text,  "%3ld",  value);
  1815.                 Text(rp,  text,  3);
  1816.                 break;
  1817.               case VARFX_GADGET:
  1818.                 Move(rp, 216,  197);
  1819.                 sprintf(text,  "%3ld",  value);
  1820.                 Text(rp,  text,  3);
  1821.                 break;
  1822.               case VIBRATE_GADGET:
  1823.                 Move(rp, 216,  207);
  1824.                 sprintf(text,  "%3ld",  value);
  1825.                 Text(rp,  text,  3);
  1826.                 break;
  1827.               case VIBDEPTH_GADGET:
  1828.                 Move(rp, 216,  217);
  1829.                 sprintf(text,  "%3ld",  value);
  1830.                 Text(rp,  text,  3);
  1831.                 break;
  1832.               case VIBDELAY_GADGET:
  1833.                 Move(rp, 216,  227);
  1834.                 sprintf(text,  "%3ld",  value);
  1835.                 Text(rp,  text,  3);
  1836.                 break;
  1837.               case FICUTOFFREQ_GADGET:
  1838.                 Move(rp, 216,  237);
  1839.                 sprintf(text,  "%3ld",  value);
  1840.                 Text(rp,  text,  3);
  1841.                 break;
  1842.               case FICUTOFFRESON_GADGET:
  1843.                 Move(rp, 216,  247);
  1844.                 sprintf(text,  "%3ld",  value);
  1845.                 Text(rp,  text,  3);
  1846.                 break;
  1847.               case ATTACK_GADGET:
  1848.                 Move(rp, 460,  56);
  1849.                 sprintf(text,  "%3ld",  value);
  1850.                 Text(rp,  text,  3);
  1851.                 break;
  1852.               case DECAY_GADGET:
  1853.                 Move(rp, 460,  66);
  1854.                 sprintf(text,  "%3ld",  value);
  1855.                 Text(rp,  text,  3);
  1856.                 break;
  1857.               case RELEASE_GADGET:
  1858.                 Move(rp, 460,  76);
  1859.                 sprintf(text,  "%3ld",  value);
  1860.                 Text(rp,  text,  3);
  1861.                 break;
  1862.               case VXON_GADGET:
  1863.                 Move(rp, 388,  67);
  1864.                 sprintf(text,  "%.3s",  vxon[value]);
  1865.                 Text(rp,  text,  3);
  1866.                 break;
  1867.               case TUNEC_GADGET:
  1868.                 Move(rp, 460,  137);
  1869.                 sprintf(text,  "%3ld",  value);
  1870.                 Text(rp,  text,  3);
  1871.                 break;
  1872.               case TUNECIS_GADGET:
  1873.                 Move(rp, 460,  147);
  1874.                 sprintf(text,  "%3ld",  value);
  1875.                 Text(rp,  text,  3);
  1876.                 break;
  1877.               case TUNED_GADGET:
  1878.                 Move(rp, 460,  157);
  1879.                 sprintf(text,  "%3ld",  value);
  1880.                 Text(rp,  text,  3);
  1881.                 break;
  1882.               case TUNEDIS_GADGET:
  1883.                 Move(rp, 460,  167);
  1884.                 sprintf(text,  "%3ld",  value);
  1885.                 Text(rp,  text,  3);
  1886.                 break;
  1887.               case TUNEE_GADGET:
  1888.                 Move(rp, 460,  177);
  1889.                 sprintf(text,  "%3ld",  value);
  1890.                 Text(rp,  text,  3);
  1891.                 break;
  1892.               case TUNEF_GADGET:
  1893.                 Move(rp, 460,  187);
  1894.                 sprintf(text,  "%3ld",  value);
  1895.                 Text(rp,  text,  3);
  1896.                 break;
  1897.               case TUNEFIS_GADGET:
  1898.                 Move(rp, 460,  197);
  1899.                 sprintf(text,  "%3ld",  value);
  1900.                 Text(rp,  text,  3);
  1901.                 break;
  1902.               case TUNEG_GADGET:
  1903.                 Move(rp, 460,  207);
  1904.                 sprintf(text,  "%3ld",  value);
  1905.                 Text(rp,  text,  3);
  1906.                 break;
  1907.               case TUNEGIS_GADGET:
  1908.                 Move(rp, 460,  217);
  1909.                 sprintf(text,  "%3ld",  value);
  1910.                 Text(rp,  text,  3);
  1911.                 break;
  1912.               case TUNEA_GADGET:
  1913.                 Move(rp, 460,  227);
  1914.                 sprintf(text,  "%3ld",  value);
  1915.                 Text(rp,  text,  3);
  1916.                 break;
  1917.               case TUNEAIS_GADGET:
  1918.                 Move(rp, 460,  237);
  1919.                 sprintf(text,  "%3ld",  value);
  1920.                 Text(rp,  text,  3);
  1921.                 break;
  1922.               case TUNEB_GADGET:
  1923.                 Move(rp, 460,  247);
  1924.                 sprintf(text,  "%3ld",  value);
  1925.                 Text(rp,  text,  3);
  1926.                 break;
  1927.               case PINILVL_GADGET:
  1928.                 Move(rp, 460,  86);
  1929.                 sprintf(text,  "%3ld",  value);
  1930.                 Text(rp,  text,  3);
  1931.                 break;
  1932.               case PATTACK_GADGET:
  1933.                 Move(rp, 460,  96);
  1934.                 sprintf(text,  "%3ld",  value);
  1935.                 Text(rp,  text,  3);
  1936.                 break;
  1937.               case PRELLVL_GADGET:
  1938.                 Move(rp, 460,  106);
  1939.                 sprintf(text,  "%3ld",  value);
  1940.                 Text(rp,  text,  3);
  1941.                 break;
  1942.               case PRELTIM_GADGET:
  1943.                 Move(rp, 460,  116);
  1944.                 sprintf(text,  "%3ld",  value);
  1945.                 Text(rp,  text,  3);
  1946.                 break;
  1947.               default:
  1948.                 break;
  1949.               }
  1950. if (votyres == 0)
  1951.     {
  1952.      sprintf(tname,  "Name:%15.15s",  (matrix[banknr * MAX_PROGRAMS+prgrm])?
  1953.                                       (char *)matrix[banknr * MAX_PROGRAMS+prgrm]:(char *)EMPTY);
  1954.     SetAPen(rp,  4);
  1955.     SetBPen(rp,  7);
  1956.     SetDrMd(rp,  INVERSVID|JAM2);
  1957.     Move(rp,  46,  47);
  1958.     Text(rp,  tname,  strlen(tname));
  1959.     }
  1960. if (votyres == 1)
  1961.     {
  1962.     swi = sw[prgrm];
  1963.     sprintf(tname,  "Name:%.11s        ", sfxvoice[swi] );
  1964.     SetAPen(rp,  4);
  1965.     SetBPen(rp,  7);
  1966.     SetDrMd(rp,  INVERSVID|JAM2);
  1967.     Move(rp,  46,  47);
  1968.     Text(rp,  tname,  20);
  1969.     }
  1970. return (value);
  1971. }
  1972.  
  1973. //to hear the changes
  1974.  
  1975. static void send_note(struct MPXGTool *tool,  const long time,  const UBYTE note)
  1976. {
  1977.   struct NoteEvent *on_event = (struct NoteEvent *)(*functions->allocevent)();
  1978.   if (on_event)
  1979.     {
  1980.       struct NoteEvent *off_event = (struct NoteEvent *)(*functions->allocevent)();
  1981.       if (off_event)
  1982.         {
  1983.           on_event->next  =
  1984.           off_event->next = NULL;
  1985.  
  1986.           on_event->type  =
  1987.           off_event->type = EVENT_VOICE;
  1988.  
  1989.           on_event->status  = MIDI_NOTEON;
  1990.           off_event->status = MIDI_NOTEOFF;
  1991.  
  1992.           on_event->value  =
  1993.           off_event->value = note;
  1994.  
  1995.           on_event->velocity = 80;
  1996.  
  1997.           on_event->time  = time;
  1998.           off_event->time = time + 96;
  1999.  
  2000.           on_event->tool  =
  2001.           off_event->tool = tool->tool.next;
  2002.  
  2003.           (*functions->qevent)(on_event);
  2004.           (*functions->qevent)(off_event);
  2005.         }
  2006.       else
  2007.         {
  2008.           (*functions->freeevent)(on_event);
  2009.         }
  2010.     }
  2011. }
  2012.  
  2013. //the center off all
  2014.  
  2015. static void __saveds edittoolcode(struct MPXGTool *tool)
  2016. {
  2017.   struct IntuiMessage *message;
  2018.   struct Window *window;
  2019.   LONG class,  code,  time;
  2020.   struct Gadget *gadget;
  2021.   struct NewWindow *newwindow;
  2022.   int i, b, c, a, revres=0;
  2023.   UBYTE bankval;
  2024.   char *revtypebt;
  2025.   char revtypebyte[11][4] ={
  2026.   "0100", "0101", "0202", "0201", "0202", "0300", "0301", "0400", "1000", "1100", "1300"};
  2027.   char storage1[32];
  2028.   char storage2[32];
  2029.   char storage3[32];
  2030.   char storage4[32];
  2031.   char storage5[32];
  2032.   char storage6[32];
  2033.   char storage7[32];
  2034.   char storage8[32];
  2035.   char storage9[32];
  2036.   char storage10[32];
  2037.   char storage11[32];
  2038.   char storage12[32];
  2039.   char storage13[32];
  2040.   char storage14[32];
  2041.   char storage15[32];
  2042.   char storage16[32];
  2043.   char storage17[32];
  2044.   char storage18[32];
  2045.   char storage19[32];
  2046.   char storage20[32];
  2047.   char storage21[32];
  2048.   char storage22[32];
  2049.   char storage23[32];
  2050.   char storage24[32];
  2051.   char storage25[32];
  2052.   char storage26[32];
  2053.   char storage27[32];
  2054.   char storage28[32];
  2055.   char storage29[32];
  2056.   char storage30[32];
  2057.   char storage31[32];
  2058.   char storage32[32];
  2059.   char storage33[32];
  2060.   char storage34[32];
  2061.   char storage35[32];
  2062.   char storage36[32];
  2063.   char storage37[32];
  2064.   char storage38[32];
  2065.   char storage39[32];
  2066.   char storage40[32];
  2067.   char storage41[32];
  2068.   char storage42[32];
  2069.   char storage43[32];
  2070.   char storage44[32];
  2071.   char storage45[32];
  2072.  
  2073.   MPXGNewWindowStructure1.Screen = functions->screen;
  2074.  
  2075.   if (tool->tool.touched & TOUCH_EDIT)
  2076.     {
  2077.       MPXGNewWindowStructure1.LeftEdge = tool->tool.left;
  2078.       MPXGNewWindowStructure1.TopEdge = tool->tool.top;
  2079.       MPXGNewWindowStructure1.Width = tool->tool.width;
  2080.       MPXGNewWindowStructure1.Height = tool->tool.height;
  2081.     }
  2082.   
  2083.   if (!tool->tool.touched)
  2084.     {
  2085.       MPXG_tool_init(tool);
  2086.     }
  2087.  
  2088.   newwindow = (struct NewWindow *) (*functions->DupeNewWindow)(&MPXGNewWindowStructure1);
  2089.   if (!newwindow)
  2090.     {
  2091.       return;
  2092.     }
  2093.   newwindow->Title = 0;
  2094.   newwindow->Flags |= BORDERLESS;
  2095.   newwindow->Flags &= ~0xF;
  2096.   newwindow->BlockPen = 0;
  2097.   newwindow->DetailPen = 0;
  2098.  
  2099.   window = (struct Window *) (*functions->FlashyOpenWindow)(newwindow);
  2100.   if (!window)
  2101.     {
  2102.       return;
  2103.     }
  2104.  
  2105.  
  2106.   tool->tool.window = window;
  2107.   (*functions->EmbossWindowOn)(window, WINDOWCLOSE|WINDOWDEPTH|WINDOWDRAG,  MPXG_NAME, (short)-1, (short)-1, 0, 0);
  2108.  
  2109.  
  2110.   (*functions->EmbossedPropOn)(window, VOICETYP_GADGET, (void *)display_routine, 2, 0);
  2111.   (*functions->EmbossedPropOn)(window, MIDICHAN_GADGET, (void *)display_routine, 16, 0);
  2112.   (*functions->EmbossedPropOn)(window, PART_GADGET, (void *)display_routine, 16, 0);
  2113.   (*functions->EmbossedPropOn)(window, MONOPOLY_GADGET, (void *)display_routine, 2, 0);
  2114.   (*functions->EmbossedPropOn)(window, PROGRAM_GADGET, (void *)display_routine, 128, 0);
  2115.   (*functions->EmbossedPropOn)(window, BANK_GADGET, (void *)display_routine, 43, 0);
  2116.   (*functions->EmbossedPropOn)(window, KEYAS_GADGET, (void *)display_routine, 3, 0);
  2117.   (*functions->EmbossedPropOn)(window, NOTESHIFT_GADGET, (void *)display_routine, 49, 0);
  2118.   (*functions->EmbossedPropOn)(window, DETUNER_GADGET, (void *)display_routine, 16, 0);
  2119.   (*functions->EmbossedPropOn)(window, DETUNEF_GADGET, (void *)display_routine, 255, 0);
  2120.  
  2121. for (i = VOLUME_GADGET; i <= RELEASE_GADGET; i++)
  2122.     {
  2123.     (*functions->EmbossedPropOn)(window, i, (void *)display_routine, 128, 0);
  2124.     }
  2125.  
  2126.   (*functions->EmbossOn)(window, VXON_GADGET, 1);
  2127.  
  2128. for (i = TUNEC_GADGET; i <= PRELTIM_GADGET; i++)
  2129.     {
  2130.     (*functions->EmbossedPropOn)(window, i, (void *)display_routine, 128, 0);
  2131.     }
  2132.  
  2133.   (*functions->EmbossOn)(window,  WRITE_GADGET,  1);
  2134.   (*functions->EmbossOn)(window,  DEFAULT_GADGET,  1);
  2135.  
  2136.   (*functions->ModifyEmbossedProp)(window,  VOICETYP_GADGET, tool->voicetyp, 0,  0,  0,  0,  0);
  2137.   (*functions->ModifyEmbossedProp)(window,  BANK_GADGET,  tool->bank,  0,  0,  0,  0,  0);
  2138.   (*functions->ModifyEmbossedProp)(window,  PROGRAM_GADGET,  tool->program,  0,  0,  0,  0,  0);
  2139.   (*functions->ModifyEmbossedProp)(window,  MIDICHAN_GADGET,  tool->midichan,  0,  0,  0,  0,  0);
  2140.   (*functions->ModifyEmbossedProp)(window,  PART_GADGET,  tool->part,  0,  0,  0,  0,  0);
  2141.   (*functions->ModifyEmbossedProp)(window,  MONOPOLY_GADGET,  tool->monopoly,  0,  0,  0,  0,  0);
  2142.   (*functions->ModifyEmbossedProp)(window,  KEYAS_GADGET,  tool->keyas,  0,  0,  0,  0,  0);
  2143.   (*functions->ModifyEmbossedProp)(window,  NOTESHIFT_GADGET,  tool->noteshift,  0,  0,  0,  0,  0);
  2144.   (*functions->ModifyEmbossedProp)(window,  DETUNER_GADGET,  tool->detuner,  0,  0,  0,  0,  0);
  2145.   (*functions->ModifyEmbossedProp)(window,  DETUNEF_GADGET,  tool->detunef,  0,  0,  0,  0,  0);
  2146.   (*functions->ModifyEmbossedProp)(window,  VOLUME_GADGET,  tool->volume,  0,  0,  0,  0,  0);
  2147.   (*functions->ModifyEmbossedProp)(window,  VELSDEPTH_GADGET,  tool->velsdepth,  0,  0,  0,  0,  0);
  2148.   (*functions->ModifyEmbossedProp)(window,  VELSOFFSET_GADGET,  tool->velsoffset,  0,  0,  0,  0,  0);
  2149.   (*functions->ModifyEmbossedProp)(window,  VELIHIGH_GADGET,  tool->velihigh,  0,  0,  0,  0,  0);
  2150.   (*functions->ModifyEmbossedProp)(window,  PAN_GADGET,  tool->pan,  0,  0,  0,  0,  0);
  2151.   (*functions->ModifyEmbossedProp)(window,  NOTELIHIGH_GADGET,  tool->notelihigh,  0,  0,  0,  0,  0);
  2152.   (*functions->ModifyEmbossedProp)(window,  NOTELILOW_GADGET,  tool->notelilow,  0,  0,  0,  0,  0);
  2153.   (*functions->ModifyEmbossedProp)(window,  DRY_GADGET,  tool->dry,  0,  0,  0,  0,  0);
  2154.   (*functions->ModifyEmbossedProp)(window,  CHORUS_GADGET,  tool->chorus,  0,  0,  0,  0,  0);
  2155.   (*functions->ModifyEmbossedProp)(window,  REVERB_GADGET,  tool->reverb,  0,  0,  0,  0,  0);
  2156.   (*functions->ModifyEmbossedProp)(window,  VARFX_GADGET,  tool->varfx,  0,  0,  0,  0,  0);
  2157.   (*functions->ModifyEmbossedProp)(window,  VIBRATE_GADGET,  tool->vibrate,  0,  0,  0,  0,  0);
  2158.   (*functions->ModifyEmbossedProp)(window,  VIBDEPTH_GADGET,  tool->vibdepth,  0,  0,  0,  0,  0);
  2159.   (*functions->ModifyEmbossedProp)(window,  VIBDELAY_GADGET,  tool->vibdelay,  0,  0,  0,  0,  0);
  2160.   (*functions->ModifyEmbossedProp)(window,  FICUTOFFREQ_GADGET,  tool->ficutoffreq,  0,  0,  0,  0,  0);
  2161.   (*functions->ModifyEmbossedProp)(window,  FICUTOFFRESON_GADGET,  tool->ficutoffreson,  0,  0,  0,  0,  0);
  2162.   (*functions->ModifyEmbossedProp)(window,  ATTACK_GADGET,  tool->attack,  0,  0,  0,  0,  0);
  2163.   (*functions->ModifyEmbossedProp)(window,  DECAY_GADGET,  tool->decay,  0,  0,  0,  0,  0);
  2164.   (*functions->ModifyEmbossedProp)(window,  RELEASE_GADGET,  tool->release,  0,  0,  0,  0,  0);
  2165.   (*functions->ModifyEmbossedProp)(window,  TUNEC_GADGET,  tool->tunec,  0,  0,  0,  0,  0);
  2166.   (*functions->ModifyEmbossedProp)(window,  TUNECIS_GADGET,  tool->tunecis,  0,  0,  0,  0,  0);
  2167.   (*functions->ModifyEmbossedProp)(window,  TUNED_GADGET,  tool->tuned,  0,  0,  0,  0,  0);
  2168.   (*functions->ModifyEmbossedProp)(window,  TUNEDIS_GADGET,  tool->tunedis,  0,  0,  0,  0,  0);
  2169.   (*functions->ModifyEmbossedProp)(window,  TUNEE_GADGET,  tool->tunee,  0,  0,  0,  0,  0);
  2170.   (*functions->ModifyEmbossedProp)(window,  TUNEF_GADGET,  tool->tunef,  0,  0,  0,  0,  0);
  2171.   (*functions->ModifyEmbossedProp)(window,  TUNEFIS_GADGET,  tool->tunefis,  0,  0,  0,  0,  0);
  2172.   (*functions->ModifyEmbossedProp)(window,  TUNEG_GADGET,  tool->tuneg,  0,  0,  0,  0,  0);
  2173.   (*functions->ModifyEmbossedProp)(window,  TUNEGIS_GADGET,  tool->tunegis,  0,  0,  0,  0,  0);
  2174.   (*functions->ModifyEmbossedProp)(window,  TUNEA_GADGET,  tool->tunea,  0,  0,  0,  0,  0);
  2175.   (*functions->ModifyEmbossedProp)(window,  TUNEAIS_GADGET,  tool->tuneais,  0,  0,  0,  0,  0);
  2176.   (*functions->ModifyEmbossedProp)(window,  TUNEB_GADGET,  tool->tuneb,  0,  0,  0,  0,  0);
  2177.   (*functions->ModifyEmbossedProp)(window,  PINILVL_GADGET,  tool->pinilvl,  0,  0,  0,  0,  0);
  2178.   (*functions->ModifyEmbossedProp)(window,  PATTACK_GADGET,  tool->pattack,  0,  0,  0,  0,  0);
  2179.   (*functions->ModifyEmbossedProp)(window,  PRELLVL_GADGET,  tool->prellvl,  0,  0,  0,  0,  0);
  2180.   (*functions->ModifyEmbossedProp)(window,  PRELTIM_GADGET,  tool->preltim,  0,  0,  0,  0,  0);
  2181.  
  2182.  for (i= VOICETYP_GADGET; i<=RELEASE_GADGET ; i++)
  2183.      {
  2184.         (*functions->DrawEmbossedProp)(window,  i);
  2185.      }
  2186.  
  2187.  (*functions->SelectEmbossed)(window,VXON_GADGET, tool->vxon);
  2188.  
  2189.  for (i= TUNEC_GADGET; i<=PRELTIM_GADGET ; i++)
  2190.      {
  2191.         (*functions->DrawEmbossedProp)(window,  i);
  2192.      }
  2193.  
  2194.   send_note(tool,  functions->timenow,  60);
  2195.   for (;;)
  2196.     {
  2197.       message = (struct IntuiMessage *) (*functions->GetIntuiMessage)(window);
  2198.       class = message->Class;
  2199.       code = message->Code;
  2200.       gadget = (struct Gadget *) message->IAddress;
  2201.       class = (*functions->SystemGadgets)(window, class, gadget, code);
  2202.  
  2203.       ReplyMsg((struct Message *)message);
  2204.  
  2205.  
  2206.       if (class == CLOSEWINDOW)
  2207.         {
  2208.           break;
  2209.         }
  2210.       else if (class == GADGETDOWN)
  2211.         {
  2212.           const short id = gadget->GadgetID;
  2213.           a = (tool->part)*45;
  2214.  
  2215.           switch (id)
  2216.             {
  2217.             case VOICETYP_GADGET:
  2218.               tool->voicetyp = (UBYTE) (*functions->DragEmbossedProp)(window,  VOICETYP_GADGET);
  2219.               tool->sliderstorage[0+a] = tool->voicetyp;
  2220.               tool->writesw[0+a] = 1;
  2221.               sprintf(storage1, "F043104C08%02lx01%02lxF7",tool->part,tool->voicetyp);
  2222.               tool->voicetypsysex = storage1;
  2223.               time = functions->timenow;
  2224.               trans_hx(tool,  time,  tool->voicetypsysex, 0);
  2225.               sprintf(storage3, "F043104C08%02lx03%02lxF7",tool->part,tool->program);
  2226.               tool->programsysex = storage3;
  2227.               time = functions->timenow;
  2228.               trans_hx(tool,  time,  tool->programsysex, 0);
  2229.               send_note(tool,  functions->timenow,  60);
  2230.               break;
  2231.             case BANK_GADGET:
  2232.               tool->bank = (UBYTE) (*functions->DragEmbossedProp)(window,  BANK_GADGET);
  2233.               tool->sliderstorage[1+a] = tool->bank;
  2234.               tool->writesw[1+a] = 1;
  2235.               sprintf(storage2, "F043104C08%02lx02%02lxF7",tool->part,bnk[tool->bank]);
  2236.               tool->banksysex = storage2;
  2237.               time = functions->timenow;
  2238.               trans_hx(tool,  time,  tool->banksysex, 0);
  2239.               sprintf(storage3, "F043104C08%02lx03%02lxF7",tool->part,tool->program);
  2240.               tool->programsysex = storage3;
  2241.               time = functions->timenow;
  2242.               trans_hx(tool,  time,  tool->programsysex, 0);
  2243.               send_note(tool,  functions->timenow,  60);
  2244.               break;
  2245.             case PROGRAM_GADGET:
  2246.               tool->program = (UBYTE) (*functions->DragEmbossedProp)(window,  PROGRAM_GADGET);
  2247.               tool->sliderstorage[2+a] = tool->program;
  2248.               tool->writesw[2+a] = 1;
  2249.               sprintf(storage3, "F043104C08%02lx03%02lxF7",tool->part,tool->program);
  2250.               tool->programsysex = storage3;
  2251.               time = functions->timenow;
  2252.               trans_hx(tool,  time,  tool->programsysex, 0);
  2253.               send_note(tool,  functions->timenow,  60);
  2254.               break;
  2255.             case MIDICHAN_GADGET:
  2256.               tool->midichan = (UBYTE) (*functions->DragEmbossedProp)(window, MIDICHAN_GADGET);
  2257.               tool->sliderstorage[3+a] = tool->midichan;
  2258.               tool->writesw[3+a] = 1;
  2259.               sprintf(storage4, "F043104C08%02lx04%02lxF7",tool->part,tool->midichan);
  2260.               tool->midichansysex = storage4;
  2261.               time = functions->timenow;
  2262.               trans_hx(tool,  time,  tool->midichansysex, 0);
  2263.               send_note(tool,  functions->timenow,  60);
  2264.               break;
  2265.             case PART_GADGET:
  2266.               tool->part = (UBYTE) (*functions->DragEmbossedProp)(window,  PART_GADGET);
  2267.               initslider(tool, window);
  2268.               send_note(tool,  functions->timenow,  60);
  2269.               break;
  2270.             case MONOPOLY_GADGET:
  2271.               tool->monopoly = (UBYTE) (*functions->DragEmbossedProp)(window,  MONOPOLY_GADGET);
  2272.               tool->sliderstorage[4+a] = tool->monopoly;
  2273.               tool->writesw[4+a] = 1;
  2274.               sprintf(storage5, "F043104C08%02lx05%02lxF7",tool->part,tool->monopoly);
  2275.               tool->monopolysysex = storage5;
  2276.               time = functions->timenow;
  2277.               trans_hx(tool,  time,  tool->monopolysysex, 0);
  2278.               send_note(tool,  functions->timenow,  60);
  2279.               break;
  2280.             case KEYAS_GADGET:
  2281.               tool->keyas = (UBYTE) (*functions->DragEmbossedProp)(window,  KEYAS_GADGET);
  2282.               tool->sliderstorage[5+a] = tool->keyas;
  2283.               tool->writesw[5+a] = 1;
  2284.               sprintf(storage6, "F043104C08%02lx06%02lxF7",tool->part,tool->keyas);
  2285.               tool->keyassysex = storage6;
  2286.               time = functions->timenow;
  2287.               trans_hx(tool,  time,  tool->keyassysex, 0);
  2288.               send_note(tool,  functions->timenow,  60);
  2289.               break;
  2290.             case NOTESHIFT_GADGET:
  2291.               tool->noteshift = (UBYTE) (*functions->DragEmbossedProp)(window,  NOTESHIFT_GADGET);
  2292.               tool->sliderstorage[6+a] = tool->noteshift;
  2293.               tool->writesw[6+a] = 1;
  2294.               sprintf(storage7, "F043104C08%02lx08%02lxF7",tool->part,tool->noteshift);
  2295.               tool->noteshiftsysex = storage7;
  2296.               time = functions->timenow;
  2297.               trans_hx(tool,  time,  tool->noteshiftsysex, 0);
  2298.               send_note(tool,  functions->timenow,  60);
  2299.               break;
  2300.             case DETUNER_GADGET:
  2301.               tool->detuner = (UBYTE) (*functions->DragEmbossedProp)(window,  DETUNER_GADGET);
  2302.               tool->sliderstorage[7+a] = tool->detuner;
  2303.               tool->writesw[7+a] = 1;
  2304.               sprintf(storage8, "F043104C08%02lx09%02lx%02lxF7",tool->part,tool->detuner,tool->detunef);
  2305.               tool->detunersysex = storage8;
  2306.               time = functions->timenow;
  2307.               trans_hx(tool,  time,  tool->detunersysex, 0);
  2308.               send_note(tool,  functions->timenow,  60);
  2309.               break;
  2310.             case DETUNEF_GADGET:
  2311.               tool->detunef = (UBYTE) (*functions->DragEmbossedProp)(window,  DETUNEF_GADGET);
  2312.               tool->sliderstorage[8+a] = tool->detunef;
  2313.               tool->writesw[8+a] = 1;
  2314.               sprintf(storage9, "F043104C08%02lx09%02lx%02lxF7",tool->part,tool->detuner,tool->detunef);
  2315.               tool->detunefsysex = storage9;
  2316.               time = functions->timenow;
  2317.               trans_hx(tool,  time,  tool->detunefsysex, 0);
  2318.               send_note(tool,  functions->timenow,  60);
  2319.               break;
  2320.             case VOLUME_GADGET:
  2321.               tool->volume = (UBYTE) (*functions->DragEmbossedProp)(window,  VOLUME_GADGET);
  2322.               tool->sliderstorage[9+a] = tool->volume;
  2323.               tool->writesw[9+a] = 1;
  2324.               sprintf(storage10, "F043104C08%02lx0B%02lxF7",tool->part,tool->volume);
  2325.               tool->volumesysex = storage10;
  2326.               time = functions->timenow;
  2327.               trans_hx(tool,  time,  tool->volumesysex, 0);
  2328.               send_note(tool,  functions->timenow,  60);
  2329.               break;
  2330.             case VELSDEPTH_GADGET:
  2331.               tool->velsdepth = (UBYTE) (*functions->DragEmbossedProp)(window,  VELSDEPTH_GADGET);
  2332.               tool->sliderstorage[10+a] = tool->velsdepth;
  2333.               tool->writesw[10+a] = 1;
  2334.               sprintf(storage11, "F043104C08%02lx0C%02lxF7",tool->part,tool->velsdepth);
  2335.               tool->velsdepthsysex = storage11;
  2336.               time = functions->timenow;
  2337.               trans_hx(tool,  time,  tool->velsdepthsysex, 0);
  2338.               send_note(tool,  functions->timenow,  60);
  2339.               break;
  2340.             case VELSOFFSET_GADGET:
  2341.               tool->velsoffset = (UBYTE) (*functions->DragEmbossedProp)(window,  VELSOFFSET_GADGET);
  2342.               tool->sliderstorage[11+a] = tool->velsoffset;
  2343.               tool->writesw[11+a] = 1;
  2344.               sprintf(storage12, "F043104C08%02lx0D%02lxF7",tool->part,tool->velsoffset);
  2345.               tool->velsoffsetsysex = storage12;
  2346.               time = functions->timenow;
  2347.               trans_hx(tool,  time,  tool->velsoffsetsysex, 0);
  2348.               send_note(tool,  functions->timenow,  60);
  2349.               break;
  2350.             case VELIHIGH_GADGET:
  2351.               tool->velihigh = (UBYTE) (*functions->DragEmbossedProp)(window,  VELIHIGH_GADGET);
  2352.               tool->sliderstorage[12+a] = tool->velihigh;
  2353.               tool->writesw[12+a] = 1;
  2354.               sprintf(storage13, "F043104C08%02lx6E%02lxF7",tool->part,tool->velihigh);
  2355.               tool->velihighsysex = storage13;
  2356.               time = functions->timenow;
  2357.               trans_hx(tool,  time,  tool->velihighsysex, 0);
  2358.               send_note(tool,  functions->timenow,  60);
  2359.               break;
  2360.             case PAN_GADGET:
  2361.               tool->pan = (UBYTE) (*functions->DragEmbossedProp)(window,  PAN_GADGET);
  2362.               tool->sliderstorage[13+a] = tool->pan;
  2363.               tool->writesw[13+a] = 1;
  2364.               sprintf(storage14, "F043104C08%02lx0E%02lxF7",tool->part,tool->pan);
  2365.               tool->pansysex = storage14;
  2366.               time = functions->timenow;
  2367.               trans_hx(tool,  time,  tool->pansysex, 0);
  2368.               send_note(tool,  functions->timenow,  60);
  2369.               break;
  2370.             case NOTELIHIGH_GADGET:
  2371.               tool->notelihigh = (UBYTE) (*functions->DragEmbossedProp)(window,  NOTELIHIGH_GADGET);
  2372.               if (tool->notelihigh < tool->notelilow)
  2373.                 {
  2374.                  tool->notelihigh = tool->notelilow;
  2375.                  (*functions->ModifyEmbossedProp)(window,  NOTELIHIGH_GADGET,  tool->notelihigh,  0,  0,  0,  0,  0);
  2376.                  (*functions->DrawEmbossedProp)(window,  NOTELIHIGH_GADGET);
  2377.                 }
  2378.               tool->sliderstorage[14+a] = tool->notelihigh;
  2379.               tool->writesw[14+a] = 1;
  2380.               sprintf(storage15, "F043104C08%02lx10%02lxF7",tool->part,tool->notelihigh);
  2381.               tool->notelihighsysex = storage15;
  2382.               time = functions->timenow;
  2383.               trans_hx(tool,  time,  tool->notelihighsysex, 0);
  2384.               send_note(tool,  functions->timenow,  60);
  2385.               break;
  2386.             case NOTELILOW_GADGET:
  2387.               tool->notelilow = (UBYTE) (*functions->DragEmbossedProp)(window,  NOTELILOW_GADGET);
  2388.               if (tool->notelilow > tool->notelihigh)
  2389.                  {
  2390.                   tool->notelilow = tool->notelihigh;
  2391.                  (*functions->ModifyEmbossedProp)(window,  NOTELILOW_GADGET,  tool->notelilow,  0,  0,  0,  0,  0);
  2392.                  (*functions->DrawEmbossedProp)(window,  NOTELILOW_GADGET);
  2393.                  }
  2394.               tool->sliderstorage[15+a] = tool->notelilow;
  2395.               tool->writesw[15+a] = 1;
  2396.               sprintf(storage16, "F043104C08%02lx0F%02lxF7",tool->part,tool->notelilow);
  2397.               tool->notelilowsysex = storage16;
  2398.               time = functions->timenow;
  2399.               trans_hx(tool,  time,  tool->notelilowsysex, 0);
  2400.               send_note(tool,  functions->timenow,  60);
  2401.               break;
  2402.             case DRY_GADGET:
  2403.               tool->dry = (UBYTE) (*functions->DragEmbossedProp)(window,  DRY_GADGET);
  2404.               tool->sliderstorage[16+a] = tool->dry;
  2405.               tool->writesw[16+a] = 1;
  2406.               sprintf(storage17, "F043104C08%02lx11%02lxF7",tool->part,tool->dry);
  2407.               tool->drysysex = storage17;
  2408.               time = functions->timenow;
  2409.               trans_hx(tool,  time,  tool->drysysex, 0);
  2410.               send_note(tool,  functions->timenow,  60);
  2411.               break;
  2412.             case CHORUS_GADGET:
  2413.               tool->chorus = (UBYTE) (*functions->DragEmbossedProp)(window,  CHORUS_GADGET);
  2414.               tool->sliderstorage[17+a] = tool->chorus;
  2415.               tool->writesw[17+a] = 1;
  2416.               sprintf(storage18, "F043104C08%02lx12%02lxF7",tool->part,tool->chorus);
  2417.               tool->chorussysex = storage18;
  2418.               time = functions->timenow;
  2419.               trans_hx(tool,  time,  tool->chorussysex, 0);
  2420.               send_note(tool,  functions->timenow,  60);
  2421.               break;
  2422.             case REVERB_GADGET:
  2423.               tool->reverb = (UBYTE) (*functions->DragEmbossedProp)(window,  REVERB_GADGET);
  2424.               tool->sliderstorage[18+a] = tool->reverb;
  2425.               tool->writesw[18+a] = 1;
  2426.               sprintf(storage19, "F043104C08%02lx13%02lxF7",tool->part,tool->reverb);
  2427.               tool->reverbsysex = storage19;
  2428.               time = functions->timenow;
  2429.               trans_hx(tool,  time,  tool->reverbsysex, 0);
  2430.               send_note(tool,  functions->timenow,  60);
  2431.               break;
  2432.             case VARFX_GADGET:
  2433.               tool->varfx = (UBYTE) (*functions->DragEmbossedProp)(window,  VARFX_GADGET);
  2434.               tool->sliderstorage[19+a] = tool->varfx;
  2435.               tool->writesw[19+a] = 1;
  2436.               sprintf(storage20, "F043104C08%02lx14%02lxF7",tool->part,tool->varfx);
  2437.               tool->varfxsysex = storage20;
  2438.               time = functions->timenow;
  2439.               trans_hx(tool,  time,  tool->varfxsysex, 0);
  2440.               send_note(tool,  functions->timenow,  60);
  2441.               break;
  2442.             case VIBRATE_GADGET:
  2443.               tool->vibrate = (UBYTE) (*functions->DragEmbossedProp)(window,  VIBRATE_GADGET);
  2444.               tool->sliderstorage[20+a] = tool->vibrate;
  2445.               tool->writesw[20+a] = 1;
  2446.               sprintf(storage21, "F043104C08%02lx15%02lxF7",tool->part,tool->vibrate);
  2447.               tool->vibratesysex = storage21;
  2448.               time = functions->timenow;
  2449.               trans_hx(tool,  time,  tool->vibratesysex, 0);
  2450.               send_note(tool,  functions->timenow,  60);
  2451.               break;
  2452.             case VIBDEPTH_GADGET:
  2453.               tool->vibdepth = (UBYTE) (*functions->DragEmbossedProp)(window,  VIBDEPTH_GADGET);
  2454.               tool->sliderstorage[21+a] = tool->vibdepth;
  2455.               tool->writesw[21+a] = 1;
  2456.               sprintf(storage22, "F043104C08%02lx16%02lxF7",tool->part,tool->vibdepth);
  2457.               tool->vibdepthsysex = storage22;
  2458.               time = functions->timenow;
  2459.               trans_hx(tool,  time,  tool->vibdepthsysex, 0);
  2460.               send_note(tool,  functions->timenow,  60);
  2461.               break;
  2462.             case VIBDELAY_GADGET:
  2463.               tool->vibdelay = (UBYTE) (*functions->DragEmbossedProp)(window,  VIBDELAY_GADGET);
  2464.               tool->sliderstorage[22+a] = tool->vibdelay;
  2465.               tool->writesw[22+a] = 1;
  2466.               sprintf(storage23, "F043104C08%02lx17%02lxF7",tool->part,tool->vibdelay);
  2467.               tool->vibdelaysysex = storage23;
  2468.               time = functions->timenow;
  2469.               trans_hx(tool,  time,  tool->vibdelaysysex, 0);
  2470.               send_note(tool,  functions->timenow,  60);
  2471.               break;
  2472.             case FICUTOFFREQ_GADGET:
  2473.               tool->ficutoffreq = (UBYTE) (*functions->DragEmbossedProp)(window,  FICUTOFFREQ_GADGET);
  2474.               tool->sliderstorage[23+a] = tool->ficutoffreq;
  2475.               tool->writesw[23+a] = 1;
  2476.               sprintf(storage24, "F043104C08%02lx18%02lxF7",tool->part,tool->ficutoffreq);
  2477.               tool->ficutoffreqsysex = storage24;
  2478.               time = functions->timenow;
  2479.               trans_hx(tool,  time,  tool->ficutoffreqsysex, 0);
  2480.               send_note(tool,  functions->timenow,  60);
  2481.               break;
  2482.             case FICUTOFFRESON_GADGET:
  2483.               tool->ficutoffreson = (UBYTE) (*functions->DragEmbossedProp)(window,  FICUTOFFRESON_GADGET);
  2484.               tool->sliderstorage[24+a] = tool->ficutoffreson;
  2485.               tool->writesw[24+a] = 1;
  2486.               sprintf(storage25, "F043104C08%02lx19%02lxF7",tool->part,tool->ficutoffreson);
  2487.               tool->ficutoffresonsysex = storage25;
  2488.               time = functions->timenow;
  2489.               trans_hx(tool,  time,  tool->ficutoffresonsysex, 0);
  2490.               send_note(tool,  functions->timenow,  60);
  2491.               break;
  2492.             case ATTACK_GADGET:
  2493.               tool->attack = (UBYTE) (*functions->DragEmbossedProp)(window,  ATTACK_GADGET);
  2494.               tool->sliderstorage[25+a] = tool->attack;
  2495.               tool->writesw[25+a] = 1;
  2496.               sprintf(storage26, "F043104C08%02lx1A%02lxF7",tool->part,tool->attack);
  2497.               tool->attacksysex = storage26;
  2498.               time = functions->timenow;
  2499.               trans_hx(tool,  time,  tool->attacksysex, 0);
  2500.               send_note(tool,  functions->timenow,  60);
  2501.               break;
  2502.             case DECAY_GADGET:
  2503.               tool->decay = (UBYTE) (*functions->DragEmbossedProp)(window,  DECAY_GADGET);
  2504.               tool->sliderstorage[26+a] = tool->decay;
  2505.               tool->writesw[26+a] = 1;
  2506.               sprintf(storage27, "F043104C08%02lx1B%02lxF7",tool->part,tool->decay);
  2507.               tool->decaysysex = storage27;
  2508.               time = functions->timenow;
  2509.               trans_hx(tool,  time,  tool->decaysysex, 0);
  2510.               send_note(tool,  functions->timenow,  60);
  2511.               break;
  2512.             case RELEASE_GADGET:
  2513.               tool->release = (UBYTE) (*functions->DragEmbossedProp)(window,  RELEASE_GADGET);
  2514.               tool->sliderstorage[27+a] = tool->release;
  2515.               tool->writesw[27+a] = 1;
  2516.               sprintf(storage28, "F043104C08%02lx1C%02lxF7",tool->part,tool->release);
  2517.               tool->releasesysex = storage28;
  2518.               time = functions->timenow;
  2519.               trans_hx(tool,  time,  tool->releasesysex, 0);
  2520.               send_note(tool,  functions->timenow,  60);
  2521.               break;
  2522.             case VXON_GADGET:
  2523.               //tool->vxon = (UBYTE) (*functions->DragEmbossedProp)(window,  VXON_GADGET);
  2524.               if (tool->vxon)
  2525.               {
  2526.                 boolchar[0]=0x2d;
  2527.                 tool->vxon = 0;
  2528.               }
  2529.               else
  2530.               {
  2531.  
  2532.                 boolchar[0]=0x2a;
  2533.                 tool->vxon = 1;
  2534.               }
  2535.               (*functions->SelectEmbossed)(window, VXON_GADGET, tool->vxon);
  2536.               tool->sliderstorage[28+a] = tool->vxon;
  2537.               tool->writesw[28+a] = 1;
  2538.               sprintf(storage29, "F043104C02015A%02lxF7",tool->vxon);
  2539.               tool->vxonsysex = storage29;
  2540.               time = functions->timenow;
  2541.               trans_hx(tool,  time,  tool->vxonsysex, 0);
  2542.               send_note(tool,  functions->timenow,  60);
  2543.               break;
  2544.             case TUNEC_GADGET:
  2545.               tool->tunec = (UBYTE) (*functions->DragEmbossedProp)(window,  TUNEC_GADGET);
  2546.               tool->sliderstorage[29+a] = tool->tunec;
  2547.               tool->writesw[29+a] = 1;
  2548.               sprintf(storage30, "F043104C08%02lx41%02lxF7",tool->part,tool->tunec);
  2549.               tool->tunecsysex = storage30;
  2550.               time = functions->timenow;
  2551.               trans_hx(tool,  time,  tool->tunecsysex, 0);
  2552.               send_note(tool,  functions->timenow,  60);
  2553.               break;
  2554.             case TUNECIS_GADGET:
  2555.               tool->tunecis = (UBYTE) (*functions->DragEmbossedProp)(window,  TUNECIS_GADGET);
  2556.               tool->sliderstorage[30+a] = tool->tunecis;
  2557.               tool->writesw[30+a] = 1;
  2558.               sprintf(storage31, "F043104C08%02lx42%02lxF7",tool->part,tool->tunecis);
  2559.               tool->tunecissysex = storage31;
  2560.               time = functions->timenow;
  2561.               trans_hx(tool,  time,  tool->tunecissysex, 0);
  2562.               send_note(tool,  functions->timenow,  60);
  2563.               break;
  2564.             case TUNED_GADGET:
  2565.               tool->tuned = (UBYTE) (*functions->DragEmbossedProp)(window,  TUNED_GADGET);
  2566.               tool->sliderstorage[31+a] = tool->tuned;
  2567.               tool->writesw[31+a] = 1;
  2568.               sprintf(storage32, "F043104C08%02lx43%02lxF7",tool->part,tool->tuned);
  2569.               tool->tunedsysex = storage32;
  2570.               time = functions->timenow;
  2571.               trans_hx(tool,  time,  tool->tunedsysex, 0);
  2572.               send_note(tool,  functions->timenow,  60);
  2573.               break;
  2574.             case TUNEDIS_GADGET:
  2575.               tool->tunedis = (UBYTE) (*functions->DragEmbossedProp)(window,  TUNEDIS_GADGET);
  2576.               tool->sliderstorage[32+a] = tool->tunedis;
  2577.               tool->writesw[32+a] = 1;
  2578.               sprintf(storage33, "F043104C08%02lx44%02lxF7",tool->part,tool->tunedis);
  2579.               tool->tunedissysex = storage33;
  2580.               time = functions->timenow;
  2581.               trans_hx(tool,  time,  tool->tunedissysex, 0);
  2582.               send_note(tool,  functions->timenow,  60);
  2583.               break;
  2584.             case TUNEE_GADGET:
  2585.               tool->tunee = (UBYTE) (*functions->DragEmbossedProp)(window,  TUNEE_GADGET);
  2586.               tool->sliderstorage[33+a] = tool->tunee;
  2587.               tool->writesw[33+a] = 1;
  2588.               sprintf(storage34, "F043104C08%02lx45%02lxF7",tool->part,tool->tunee);
  2589.               tool->tuneesysex = storage34;
  2590.               time = functions->timenow;
  2591.               trans_hx(tool,  time,  tool->tuneesysex, 0);
  2592.               send_note(tool,  functions->timenow,  60);
  2593.               break;
  2594.             case TUNEF_GADGET:
  2595.               tool->tunef = (UBYTE) (*functions->DragEmbossedProp)(window,  TUNEF_GADGET);
  2596.               tool->sliderstorage[34+a] = tool->tunef;
  2597.               tool->writesw[34+a] = 1;
  2598.               sprintf(storage35, "F043104C08%02lx46%02lxF7",tool->part,tool->tunef);
  2599.               tool->tunefsysex = storage35;
  2600.               time = functions->timenow;
  2601.               trans_hx(tool,  time,  tool->tunefsysex, 0);
  2602.               send_note(tool,  functions->timenow,  60);
  2603.               break;
  2604.             case TUNEFIS_GADGET:
  2605.               tool->tunefis = (UBYTE) (*functions->DragEmbossedProp)(window,  TUNEFIS_GADGET);
  2606.               tool->sliderstorage[35+a] = tool->tunefis;
  2607.               tool->writesw[35+a] = 1;
  2608.               sprintf(storage36, "F043104C08%02lx47%02lxF7",tool->part,tool->tunefis);
  2609.               tool->tunefissysex = storage36;
  2610.               time = functions->timenow;
  2611.               trans_hx(tool,  time,  tool->tunefissysex, 0);
  2612.               send_note(tool,  functions->timenow,  60);
  2613.               break;
  2614.             case TUNEG_GADGET:
  2615.               tool->tuneg = (UBYTE) (*functions->DragEmbossedProp)(window,  TUNEG_GADGET);
  2616.               tool->sliderstorage[36+a] = tool->tuneg;
  2617.               tool->writesw[36+a] = 1;
  2618.               sprintf(storage37, "F043104C08%02lx48%02lxF7",tool->part,tool->tuneg);
  2619.               tool->tunegsysex = storage37;
  2620.               time = functions->timenow;
  2621.               trans_hx(tool,  time,  tool->tunegsysex, 0);
  2622.               send_note(tool,  functions->timenow,  60);
  2623.               break;
  2624.             case TUNEGIS_GADGET:
  2625.               tool->tunegis = (UBYTE) (*functions->DragEmbossedProp)(window,  TUNEGIS_GADGET);
  2626.               tool->sliderstorage[37+a] = tool->tunegis;
  2627.               tool->writesw[37+a] = 1;
  2628.               sprintf(storage38, "F043104C08%02lx49%02lxF7",tool->part,tool->tunegis);
  2629.               tool->tunegissysex = storage38;
  2630.               time = functions->timenow;
  2631.               trans_hx(tool,  time,  tool->tunegissysex, 0);
  2632.               send_note(tool,  functions->timenow,  60);
  2633.               break;
  2634.             case TUNEA_GADGET:
  2635.               tool->tunea = (UBYTE) (*functions->DragEmbossedProp)(window,  TUNEA_GADGET);
  2636.               tool->sliderstorage[38+a] = tool->tunea;
  2637.               tool->writesw[38+a] = 1;
  2638.               sprintf(storage39, "F043104C08%02lx4A%02lxF7",tool->part,tool->tunea);
  2639.               tool->tuneasysex = storage39;
  2640.               time = functions->timenow;
  2641.               trans_hx(tool,  time,  tool->tuneasysex, 0);
  2642.               send_note(tool,  functions->timenow,  60);
  2643.               break;
  2644.             case TUNEAIS_GADGET:
  2645.               tool->tuneais = (UBYTE) (*functions->DragEmbossedProp)(window,  TUNEAIS_GADGET);
  2646.               tool->sliderstorage[39+a] = tool->tuneais;
  2647.               tool->writesw[39+a] = 1;
  2648.               sprintf(storage40, "F043104C08%02lx4B%02lxF7",tool->part,tool->tuneais);
  2649.               tool->tuneaissysex = storage40;
  2650.               time = functions->timenow;
  2651.               trans_hx(tool,  time,  tool->tuneaissysex, 0);
  2652.               send_note(tool,  functions->timenow,  60);
  2653.               break;
  2654.             case TUNEB_GADGET:
  2655.               tool->tuneb = (UBYTE) (*functions->DragEmbossedProp)(window,  TUNEB_GADGET);
  2656.               tool->sliderstorage[40+a] = tool->tuneb;
  2657.               tool->writesw[40+a] = 1;
  2658.               sprintf(storage41, "F043104C08%02lx4C%02lxF7",tool->part,tool->tuneb);
  2659.               tool->tunebsysex = storage41;
  2660.               time = functions->timenow;
  2661.               trans_hx(tool,  time,  tool->tunebsysex, 0);
  2662.               send_note(tool,  functions->timenow,  60);
  2663.               break;
  2664.             case PINILVL_GADGET:
  2665.               tool->pinilvl = (UBYTE) (*functions->DragEmbossedProp)(window,  PINILVL_GADGET);
  2666.               tool->sliderstorage[41+a] = tool->pinilvl;
  2667.               tool->writesw[41+a] = 1;
  2668.               sprintf(storage42, "F043104C08%02lx69%02lxF7",tool->part,tool->pinilvl);
  2669.               tool->pinilvlsysex = storage42;
  2670.               time = functions->timenow;
  2671.               trans_hx(tool,  time,  tool->pinilvlsysex, 0);
  2672.               send_note(tool,  functions->timenow,  60);
  2673.               break;
  2674.             case PATTACK_GADGET:
  2675.               tool->pattack = (UBYTE) (*functions->DragEmbossedProp)(window,  PATTACK_GADGET);
  2676.               tool->sliderstorage[42+a] = tool->pattack;
  2677.               tool->writesw[42+a] = 1;
  2678.               sprintf(storage43, "F043104C08%02lx6A%02lxF7",tool->part,tool->pattack);
  2679.               tool->pattacksysex = storage43;
  2680.               time = functions->timenow;
  2681.               trans_hx(tool,  time,  tool->pattacksysex, 0);
  2682.               send_note(tool,  functions->timenow,  60);
  2683.               break;
  2684.             case PRELLVL_GADGET:
  2685.               tool->prellvl = (UBYTE) (*functions->DragEmbossedProp)(window,  PRELLVL_GADGET);
  2686.               tool->sliderstorage[43+a] = tool->prellvl;
  2687.               tool->writesw[43+a] = 1;
  2688.               sprintf(storage44, "F043104C08%02lx6B%02lxF7",tool->part,tool->prellvl);
  2689.               tool->prellvlsysex = storage44;
  2690.               time = functions->timenow;
  2691.               trans_hx(tool,  time,  tool->prellvlsysex, 0);
  2692.               send_note(tool,  functions->timenow,  60);
  2693.               break;
  2694.             case PRELTIM_GADGET:
  2695.               tool->preltim = (UBYTE) (*functions->DragEmbossedProp)(window,  PRELTIM_GADGET);
  2696.               tool->sliderstorage[44+a] = tool->preltim;
  2697.               tool->writesw[44+a] = 1;
  2698.               sprintf(storage45, "F043104C08%02lx6C%02lxF7",tool->part,tool->preltim);
  2699.               tool->preltimsysex = storage45;
  2700.               time = functions->timenow;
  2701.               trans_hx(tool,  time,  tool->preltimsysex, 0);
  2702.               send_note(tool,  functions->timenow,  60);
  2703.               break;
  2704.              case DEFAULT_GADGET:
  2705.               defaultslider(tool, window);
  2706.               send_note(tool,  functions->timenow,  60);
  2707.               break;
  2708.              case WRITE_GADGET:
  2709.               if ((*functions->areyousure)("write to track ? Play-pointer on right place ?"))
  2710.                   {
  2711.                   if (!functions->running)
  2712.                     {
  2713.                     time = functions->starttime;
  2714.                     for (b=0; b<=15; b++)
  2715.                       {
  2716.                       if (tool->writesw[(b*45)] == 1)
  2717.                           {
  2718.                           sprintf(storage1, "F043104C08%02lx01%02lxF7",b,tool->sliderstorage[b*45]);
  2719.                           tool->voicetypsysex = storage1;
  2720.                           trans_hx(tool, time+1, tool->voicetypsysex, 1);
  2721.                           }
  2722.                       if (tool->writesw[1+(b*45)] == 1)
  2723.                           {
  2724.                           sprintf(storage2, "F043104C08%02lx02%02lxF7",b,tool->sliderstorage[b*45+1]);
  2725.                           tool->banksysex = storage2;
  2726.                           trans_hx(tool, time+2, tool->banksysex, 1);
  2727.                           }
  2728.                       if (tool->writesw[2+(b*45)] == 1)
  2729.                           {
  2730.                           sprintf(storage3, "F043104C08%02lx03%02lxF7",b,tool->sliderstorage[b*45+2]);
  2731.                           tool->programsysex = storage3;
  2732.                           trans_hx(tool, time+3, tool->programsysex, 1);
  2733.                           }
  2734.                       if (tool->writesw[3+(b*45)] == 1)
  2735.                           {
  2736.                           sprintf(storage4, "F043104C08%02lx04%02lxF7",b,tool->sliderstorage[b*45+3]);
  2737.                           tool->midichansysex = storage4;
  2738.                           trans_hx(tool, time, tool->midichansysex, 1);
  2739.                           }
  2740.                       if (tool->writesw[4+(b*45)] == 1)
  2741.                           {
  2742.                           sprintf(storage5, "F043104C08%02lx05%02lxF7",b,tool->sliderstorage[b*45+4]);
  2743.                           tool->monopolysysex = storage5;
  2744.                           trans_hx(tool, time+4, tool->monopolysysex, 1);
  2745.                           }
  2746.                       if (tool->writesw[5+(b*45)] == 1)
  2747.                           {
  2748.                           sprintf(storage6, "F043104C08%02lx06%02lxF7",b,tool->sliderstorage[b*45+5]);
  2749.                           tool->keyassysex = storage6;
  2750.                           trans_hx(tool, time+5, tool->keyassysex, 1);
  2751.                           }
  2752.                       if (tool->writesw[6+(b*45)] == 1)
  2753.                           {
  2754.                           sprintf(storage7, "F043104C08%02lx08%02lxF7",b,tool->sliderstorage[b*45+6]);
  2755.                           tool->noteshiftsysex = storage7;
  2756.                           trans_hx(tool, time+6, tool->noteshiftsysex, 1);
  2757.                           }
  2758.                       if (tool->writesw[7+(b*45)] == 1)         // detuner & detunef - data
  2759.                           {
  2760.                           sprintf(storage8, "F043104C08%02lx09%02lx%02lxF7",b,tool->sliderstorage[b*45+7],tool->sliderstorage[b*45+8]);
  2761.                           tool->detunersysex = storage8;
  2762.                           trans_hx(tool, time+7, tool->detunersysex, 1);
  2763.                           }
  2764.                       if (tool->writesw[9+(b*45)] == 1)
  2765.                           {
  2766.                           sprintf(storage10, "F043104C08%02lx0B%02lxF7",b,tool->sliderstorage[b*45+9]);
  2767.                           tool->volumesysex = storage10;
  2768.                           trans_hx(tool, time+8, tool->volumesysex, 1);
  2769.                           }
  2770.                       if (tool->writesw[10+(b*45)] == 1)
  2771.                           {
  2772.                           sprintf(storage11, "F043104C08%02lx0C%02lxF7",b,tool->sliderstorage[b*45+10]);
  2773.                           tool->velsdepthsysex = storage11;
  2774.                           trans_hx(tool, time+9, tool->velsdepthsysex, 1);
  2775.                           }
  2776.                       if (tool->writesw[11+(b*45)] == 1)
  2777.                           {
  2778.                           sprintf(storage12, "F043104C08%02lx0D%02lxF7",b,tool->sliderstorage[b*45+11]);
  2779.                           tool->velsoffsetsysex = storage12;
  2780.                           trans_hx(tool, time+10, tool->velsoffsetsysex, 1);
  2781.                           }
  2782.                       if (tool->writesw[12+(b*45)] == 1)
  2783.                           {
  2784.                           sprintf(storage13, "F043104C08%02lx6E%02lxF7",b,tool->sliderstorage[b*45+12]);
  2785.                           tool->velihighsysex = storage13;
  2786.                           trans_hx(tool, time+11, tool->velihighsysex, 1);
  2787.                           }
  2788.                       if (tool->writesw[13+(b*45)] == 1)
  2789.                           {
  2790.                           sprintf(storage14, "F043104C08%02lx0E%02lxF7",b,tool->sliderstorage[b*45+13]);
  2791.                           tool->pansysex = storage14;
  2792.                           trans_hx(tool, time+12, tool->pansysex, 1);
  2793.                           }
  2794.                       if (tool->writesw[14+(b*45)] == 1)
  2795.                           {
  2796.                           sprintf(storage15, "F043104C08%02lx10%02lxF7",b,tool->sliderstorage[b*45+14]);
  2797.                           tool->notelihighsysex = storage15;
  2798.                           trans_hx(tool, time+13, tool->notelihighsysex, 1);
  2799.                           }
  2800.                       if (tool->writesw[15+(b*45)] == 1)
  2801.                           {
  2802.                           sprintf(storage16, "F043104C08%02lx0F%02lxF7",b,tool->sliderstorage[b*45+15]);
  2803.                           tool->notelilowsysex = storage16;
  2804.                           trans_hx(tool, time+14, tool->notelilowsysex, 1);
  2805.                           }
  2806.                       if (tool->writesw[16+(b*45)] == 1)
  2807.                           {
  2808.                           sprintf(storage17, "F043104C08%02lx11%02lxF7",b,tool->sliderstorage[b*45+16]);
  2809.                           tool->drysysex = storage17;
  2810.                           trans_hx(tool, time+15, tool->drysysex, 1);
  2811.                           }
  2812.                       if (tool->writesw[17+(b*45)] == 1)
  2813.                           {
  2814.                           sprintf(storage18, "F043104C08%02lx12%02lxF7",b,tool->sliderstorage[b*45+17]);
  2815.                           tool->chorussysex = storage18;
  2816.                           trans_hx(tool, time+16, tool->chorussysex, 1);
  2817.                           }
  2818.                       if (tool->writesw[18+(b*45)] == 1)
  2819.                           {
  2820.                           sprintf(storage19, "F043104C08%02lx13%02lxF7",b,tool->sliderstorage[b*45+18]);
  2821.                           tool->reverbsysex = storage19;
  2822.                           trans_hx(tool, time+17, tool->reverbsysex, 1);
  2823.                           }
  2824.                       if (tool->writesw[19+(b*45)] == 1)
  2825.                           {
  2826.                           sprintf(storage20, "F043104C08%02lx14%02lxF7",b,tool->sliderstorage[b*45+19]);
  2827.                           tool->varfxsysex = storage20;
  2828.                           trans_hx(tool, time+18, tool->varfxsysex, 1);
  2829.                           }
  2830.                       if (tool->writesw[20+(b*45)] == 1)
  2831.                           {
  2832.                           sprintf(storage21, "F043104C08%02lx15%02lxF7",b,tool->sliderstorage[b*45+20]);
  2833.                           tool->vibratesysex = storage21;
  2834.                           trans_hx(tool, time+19, tool->vibratesysex, 1);
  2835.                           }
  2836.                       if (tool->writesw[21+(b*45)] == 1)
  2837.                           {
  2838.                           sprintf(storage22, "F043104C08%02lx16%02lxF7",b,tool->sliderstorage[b*45+21]);
  2839.                           tool->vibdepthsysex = storage22;
  2840.                           trans_hx(tool, time+20, tool->vibdepthsysex, 1);
  2841.                           }
  2842.                       if (tool->writesw[22+(b*45)] == 1)
  2843.                           {
  2844.                           sprintf(storage23, "F043104C08%02lx17%02lxF7",b,tool->sliderstorage[b*45+22]);
  2845.                           tool->vibdelaysysex = storage23;
  2846.                           trans_hx(tool, time+21, tool->vibdelaysysex, 1);
  2847.                           }
  2848.                       if (tool->writesw[23+(b*45)] == 1)
  2849.                           {
  2850.                           sprintf(storage24, "F043104C08%02lx18%02lxF7",b,tool->sliderstorage[b*45+23]);
  2851.                           tool->ficutoffreqsysex = storage24;
  2852.                           trans_hx(tool, time+22, tool->ficutoffreqsysex, 1);
  2853.                           }
  2854.                       if (tool->writesw[24+(b*45)] == 1)
  2855.                           {
  2856.                           sprintf(storage25, "F043104C08%02lx19%02lxF7",b,tool->sliderstorage[b*45+24]);
  2857.                           tool->ficutoffresonsysex = storage25;
  2858.                           trans_hx(tool, time+23, tool->ficutoffresonsysex, 1);
  2859.                           }
  2860.                       if (tool->writesw[25+(b*45)] == 1)
  2861.                           {
  2862.                           sprintf(storage26, "F043104C08%02lx1A%02lxF7",b,tool->sliderstorage[b*45+25]);
  2863.                           tool->attacksysex = storage26;
  2864.                           trans_hx(tool, time+24, tool->attacksysex, 1);
  2865.                           }
  2866.                       if (tool->writesw[26+(b*45)] == 1)
  2867.                           {
  2868.                           sprintf(storage27, "F043104C08%02lx1B%02lxF7",b,tool->sliderstorage[b*45+26]);
  2869.                           tool->decaysysex = storage27;
  2870.                           trans_hx(tool, time+25, tool->decaysysex, 1);
  2871.                           }
  2872.                       if (tool->writesw[27+(b*45)] == 1)
  2873.                           {
  2874.                           sprintf(storage28, "F043104C08%02lx1C%02lxF7",b,tool->sliderstorage[b*45+27]);
  2875.                           tool->releasesysex = storage28;
  2876.                           trans_hx(tool, time+26, tool->releasesysex, 1);
  2877.                           }
  2878.                       if (tool->writesw[28+(b*45)] == 1)
  2879.                           {
  2880.                           sprintf(storage29, "F043104C02015A%02lxF7",tool->sliderstorage[b*45+28]);
  2881.                           tool->vxonsysex = storage29;
  2882.                           trans_hx(tool, time+27, tool->vxonsysex, 1);
  2883.                           }
  2884.                       if (tool->writesw[29+(b*45)] == 1)
  2885.                           {
  2886.                           sprintf(storage30, "F043104C08%02lx41%02lxF7",b,tool->sliderstorage[b*45+29]);
  2887.                           tool->tunecsysex = storage30;
  2888.                           trans_hx(tool, time+28, tool->tunecsysex, 1);
  2889.                           }
  2890.                       if (tool->writesw[30+(b*45)] == 1)
  2891.                           {
  2892.                           sprintf(storage31, "F043104C08%02lx42%02lxF7",b,tool->sliderstorage[b*45+30]);
  2893.                           tool->tunecissysex = storage31;
  2894.                           trans_hx(tool, time+29, tool->tunecissysex, 1);
  2895.                           }
  2896.                       if (tool->writesw[31+(b*45)] == 1)
  2897.                           {
  2898.                           sprintf(storage32, "F043104C08%02lx43%02lxF7",b,tool->sliderstorage[b*45+31]);
  2899.                           tool->tunedsysex = storage32;
  2900.                           trans_hx(tool, time+30, tool->tunedsysex, 1);
  2901.                           }
  2902.                       if (tool->writesw[32+(b*45)] == 1)
  2903.                           {
  2904.                           sprintf(storage33, "F043104C08%02lx44%02lxF7",b,tool->sliderstorage[b*45+32]);
  2905.                           tool->tunedissysex = storage33;
  2906.                           trans_hx(tool, time+31, tool->tunedissysex, 1);
  2907.                           }
  2908.                       if (tool->writesw[33+(b*45)] == 1)
  2909.                           {
  2910.                           sprintf(storage34, "F043104C08%02lx45%02lxF7",b,tool->sliderstorage[b*45+33]);
  2911.                           tool->tuneesysex = storage34;
  2912.                           trans_hx(tool, time+32, tool->tuneesysex, 1);
  2913.                           }
  2914.                       if (tool->writesw[34+(b*45)] == 1)
  2915.                           {
  2916.                           sprintf(storage35, "F043104C08%02lx46%02lxF7",b,tool->sliderstorage[b*45+34]);
  2917.                           tool->tunefsysex = storage35;
  2918.                           trans_hx(tool, time+33, tool->tunefsysex, 1);
  2919.                           }
  2920.                       if (tool->writesw[35+(b*45)] == 1)
  2921.                           {
  2922.                           sprintf(storage36, "F043104C08%02lx47%02lxF7",b,tool->sliderstorage[b*45+35]);
  2923.                           tool->tunefissysex = storage36;
  2924.                           trans_hx(tool, time+34, tool->tunefissysex, 1);
  2925.                           }
  2926.                       if (tool->writesw[36+(b*45)] == 1)
  2927.                           {
  2928.                           sprintf(storage37, "F043104C08%02lx48%02lxF7",b,tool->sliderstorage[b*45+36]);
  2929.                           tool->tunegsysex = storage37;
  2930.                           trans_hx(tool, time+35, tool->tunegsysex, 1);
  2931.                           }
  2932.                       if (tool->writesw[37+(b*45)] == 1)
  2933.                           {
  2934.                           sprintf(storage38, "F043104C08%02lx49%02lxF7",b,tool->sliderstorage[b*45+37]);
  2935.                           tool->tunegissysex = storage38;
  2936.                           trans_hx(tool, time+36, tool->tunegissysex, 1);
  2937.                           }
  2938.                       if (tool->writesw[38+(b*45)] == 1)
  2939.                           {
  2940.                           sprintf(storage39, "F043104C08%02lx4A%02lxF7",b,tool->sliderstorage[b*45+38]);
  2941.                           tool->tuneasysex = storage39;
  2942.                           trans_hx(tool, time+37, tool->tuneasysex, 1);
  2943.                           }
  2944.                       if (tool->writesw[39+(b*45)] == 1)
  2945.                           {
  2946.                           sprintf(storage40, "F043104C08%02lx4B%02lxF7",b,tool->sliderstorage[b*45+39]);
  2947.                           tool->tuneaissysex = storage40;
  2948.                           trans_hx(tool, time+38, tool->tuneaissysex, 1);
  2949.                           }
  2950.                       if (tool->writesw[40+(b*45)] == 1)
  2951.                           {
  2952.                           sprintf(storage41, "F043104C08%02lx4C%02lxF7",b,tool->sliderstorage[b*45+40]);
  2953.                           tool->tunebsysex = storage41;
  2954.                           trans_hx(tool, time+39, tool->tunebsysex, 1);
  2955.                           }
  2956.                       if (tool->writesw[41+(b*45)] == 1)
  2957.                           {
  2958.                           sprintf(storage42, "F043104C08%02lx69%02lxF7",b,tool->sliderstorage[b*45+41]);
  2959.                           tool->pinilvlsysex = storage42;
  2960.                           trans_hx(tool, time+40, tool->pinilvlsysex, 1);
  2961.                           }
  2962.                       if (tool->writesw[42+(b*45)] == 1)
  2963.                           {
  2964.                           sprintf(storage43, "F043104C08%02lx6A%02lxF7",b,tool->sliderstorage[b*45+42]);
  2965.                           tool->pattacksysex = storage43;
  2966.                           trans_hx(tool, time+41, tool->pattacksysex, 1);
  2967.                           }
  2968.                       if (tool->writesw[43+(b*45)] == 1)
  2969.                           {
  2970.                           sprintf(storage44, "F043104C08%02lx6B%02lxF7",b,tool->sliderstorage[b*45+43]);
  2971.                           tool->prellvlsysex = storage44;
  2972.                           trans_hx(tool, time+42, tool->prellvlsysex, 1);
  2973.                           }
  2974.                       if (tool->writesw[44+(b*45)] == 1)
  2975.                           {
  2976.                           sprintf(storage45, "F043104C08%02lx6C%02lxF7",b,tool->sliderstorage[b*45+44]);
  2977.                           tool->preltimsysex = storage45;
  2978.                           trans_hx(tool, time+43, tool->preltimsysex, 1);
  2979.                           }
  2980.  
  2981.                       time=time+50;
  2982.                       }
  2983.                     }
  2984.                   }
  2985.               send_note(tool,  functions->timenow,  60);
  2986.               break;
  2987.              default:
  2988.               break;
  2989.             }
  2990.         }
  2991.       else if (class == GADGETUP)
  2992.         {
  2993.           /* Nothing. */
  2994.         }
  2995.     }
  2996.   tool->tool.window = 0;
  2997.   tool->tool.left = window->LeftEdge;
  2998.   tool->tool.top = window->TopEdge;
  2999.   tool->tool.width = window->Width;
  3000.   tool->tool.height = window->Height;
  3001.   tool->tool.touched = TOUCH_INIT | TOUCH_EDIT;
  3002.  
  3003.   for (i = VOICETYP_GADGET;
  3004.        i <= PRELTIM_GADGET;
  3005.        i ++)
  3006.     {
  3007.       (*functions->EmbossedPropOff)(window, i);
  3008.     }
  3009.  
  3010.   (*functions->EmbossOff)(window,  WRITE_GADGET);
  3011.   (*functions->EmbossOff)(window,  DEFAULT_GADGET);
  3012.  
  3013.   (*functions->EmbossWindowOff)(window);
  3014.   (*functions->FlashyCloseWindow)(window);
  3015.   (*functions->DeleteNewWindow)(newwindow);
  3016. }
  3017.  
  3018. //to leave the tool correct
  3019.  
  3020. void __saveds removetool()
  3021. {
  3022. FreeVec(matrix);
  3023. FreeVec(MPXG);
  3024. }
  3025.  
  3026. //start of the tool
  3027.  
  3028. struct ToolMaster * inittoolmaster()
  3029. {
  3030.   int i = 0,  pbank = 0, sfxpbank = 0;
  3031.  
  3032.   if (!(MPXG=(UWORD *)AllocVec(sizeof (MPXGdata), MEMF_CHIP|MEMF_CLEAR))) return(NULL);
  3033.   CopyMem(&MPXGdata, MPXG,  sizeof (MPXGdata));
  3034.  
  3035.   if(!(matrix = (STRPTR *)AllocVec(MAX_BANKS*MAX_PROGRAMS*sizeof(STRPTR), MEMF_ANY|MEMF_CLEAR)))
  3036.   return(NULL);
  3037.  
  3038.    while (v[i].bank != BE)
  3039.    {
  3040.  
  3041.        pbank = v[i].bank;
  3042.        matrix[pbank * MAX_PROGRAMS + v[i].program] = (STRPTR)v[i].name;
  3043.        i++;
  3044.    }
  3045.  
  3046.  
  3047.   MPXG_image.ImageData = MPXG;
  3048.   memset((char *)&master, 0, sizeof(struct ToolMaster));
  3049.   master.toolid = MPXG_ID;
  3050.   master.image = &MPXG_image;
  3051.   strcpy(master.name,  MPXG_NAME);
  3052.   master.edittool = edittoolcode;
  3053.   master.processevent = processeventcode;
  3054.   master.tooltype = MPXG_TYPE;
  3055.   master.toolsize = sizeof(struct MPXGTool);
  3056.   master.removetool = removetool;
  3057.   return(&master);
  3058. }
  3059.